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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA56BC433F5 for ; Mon, 24 Jan 2022 08:52:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 75E856B0081; Mon, 24 Jan 2022 03:52:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 70D0E6B0083; Mon, 24 Jan 2022 03:52:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5FE366B0085; Mon, 24 Jan 2022 03:52:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0219.hostedemail.com [216.40.44.219]) by kanga.kvack.org (Postfix) with ESMTP id 50CF26B0081 for ; Mon, 24 Jan 2022 03:52:52 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 092998249980 for ; Mon, 24 Jan 2022 08:52:52 +0000 (UTC) X-FDA: 79064565384.21.60007BD Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf24.hostedemail.com (Postfix) with ESMTP id 92F57180012 for ; Mon, 24 Jan 2022 08:52:51 +0000 (UTC) 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 X-Stat-Signature: f73kzkxbqkit17o16pbcz344zzhf5drg Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=Q74tALB3; dmarc=none; spf=none (imf24.hostedemail.com: domain of BATV+b18af077b488c69bdec9+6728+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+b18af077b488c69bdec9+6728+infradead.org+hch@bombadil.srs.infradead.org X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 92F57180012 X-HE-Tag: 1643014371-992656 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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