From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2120AC433EF for ; Mon, 24 Jan 2022 08:52:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242379AbiAXIwu (ORCPT ); Mon, 24 Jan 2022 03:52:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236352AbiAXIwu (ORCPT ); Mon, 24 Jan 2022 03:52:50 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D70EC06173B; Mon, 24 Jan 2022 00:52:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=WvCY12wHxPzG4OETwKwaljrTU1izZxdh7HCBu8mC+yI=; b=Q74tALB3CgO83ke5RywzEcvejB /pe9pswNd/EjHS9XIdzGTo366i9HaDsqng0Enj1wbklRO4o5tk6pfrSSj1fJyBa9W5NacnnEwPu5f 5trKrx2aAEvPn7VImxWoagVeoxbZjd+Ctb5u+Pl75Nwq28p7AVC+RNG9sEBOpldoT0at0cowrz5Wn HrYFUP/97HF39o51YTzJ80pvGswYvxcgME8DeizzlGB2VTKajB1ushjDx10QF5ZbT4hUshVsI2zIA 6uNwVam/Px1Dw2edWSbp5ccJRFcwXm/eDxnLIrKcx1Pr8bUpd2QEZl03COb/RmYxOiNLFbd7b3WaZ bsfgHqbg==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nBv5i-002fpo-HJ; Mon, 24 Jan 2022 08:52:46 +0000 Date: Mon, 24 Jan 2022 00:52:46 -0800 From: Christoph Hellwig To: NeilBrown Cc: Trond Myklebust , Anna Schumaker , Chuck Lever , Andrew Morton , Mel Gorman , Christoph Hellwig , David Howells , linux-nfs@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 09/23] MM: submit multipage reads for SWP_FS_OPS swap-space Message-ID: References: <164299573337.26253.7538614611220034049.stgit@noble.brown> <164299611278.26253.14950274629759580371.stgit@noble.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <164299611278.26253.14950274629759580371.stgit@noble.brown> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Jan 24, 2022 at 02:48:32PM +1100, NeilBrown wrote: > swap_readpage() is given one page at a time, but maybe called repeatedly > in succession. > For block-device swapspace, the blk_plug functionality allows the > multiple pages to be combined together at lower layers. > That cannot be used for SWP_FS_OPS as blk_plug may not exist - it is > only active when CONFIG_BLOCK=y. Consequently all swap reads over NFS > are single page reads. > > With this patch we pass in a pointer-to-pointer when swap_readpage can > store state between calls - much like the effect of blk_plug. After > calling swap_readpage() some number of times, the state will be passed > to swap_read_unplug() which can submit the combined request. > > Some caller currently call blk_finish_plug() *before* the final call to > swap_readpage(), so the last page cannot be included. This patch moves > blk_finish_plug() to after the last call, and calls swap_read_unplug() > there too. Buildbot complais that we might need a forward declaration of struct swap_iocb, but otherwise this looks good: Reviewed-by: Christoph Hellwig