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 838BDC433F5 for ; Tue, 8 Feb 2022 11:07:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 082A86B0074; Tue, 8 Feb 2022 06:07:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0325E6B0075; Tue, 8 Feb 2022 06:07:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E64E16B0078; Tue, 8 Feb 2022 06:07:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0245.hostedemail.com [216.40.44.245]) by kanga.kvack.org (Postfix) with ESMTP id D91286B0074 for ; Tue, 8 Feb 2022 06:07:55 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 95169181DD43E for ; Tue, 8 Feb 2022 11:07:55 +0000 (UTC) X-FDA: 79119337710.26.DF0082F Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) by imf03.hostedemail.com (Postfix) with ESMTP id 2CEBE20006 for ; Tue, 8 Feb 2022 11:07:55 +0000 (UTC) Received: by mail-vs1-f54.google.com with SMTP id l14so2923133vsm.3 for ; Tue, 08 Feb 2022 03:07:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zLRCIZiUQ4EqimYPFyGlj6mR3eFhIcoRvYTw8GfHVOA=; b=gS0sC44Y8EndPtMBgM96mIlXqTdMB0lq0I1zL86+RdUGTHWb6PXsQLU/TAtsn8/gjZ prdc7QEW7asYc1aCIAkz+y/2pGEaSpkPxvm+vDwuQYltMQZ5GBMtF9v+e52Uxba/nywp mOc7Pe0b5wh5ur0ROIbbvH+j/F6GHe61mNG0DMp0Ga1Fyilbg7otEsD4ypEpxIbfT4KU z1DWBs+7muOOqZRjAxkgElGMuzYbFulcBnriCIpLC7fNFtDR+ZKGgwMsgSRof0irnW6y hXviQpNkmNLQ52832D7GmmA/5CkOKVKpVHF8PuNpvfpyAMUKDVU5EuTt4qqfPnbfpV8n x6+g== X-Gm-Message-State: AOAM531BA/BgK5JB7XQwVYb2Xbva46ByucfwkuhNU0ypM+oEPp+MAWkf fgKP5tsR5ziKvANF5hzLa6jHHPkoEOYv6Q== X-Google-Smtp-Source: ABdhPJyobzQ4RZWeB4C41JSFSqEzKe6Zoc5/mf0dbPjXJkE2RqZgCrbW9s3pXfC7U+Z2Q03VrJN9HA== X-Received: by 2002:a67:f542:: with SMTP id z2mr913825vsn.43.1644318474233; Tue, 08 Feb 2022 03:07:54 -0800 (PST) Received: from mail-vk1-f182.google.com (mail-vk1-f182.google.com. [209.85.221.182]) by smtp.gmail.com with ESMTPSA id b24sm501052uaw.1.2022.02.08.03.07.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 03:07:53 -0800 (PST) Received: by mail-vk1-f182.google.com with SMTP id o15so9562511vki.2 for ; Tue, 08 Feb 2022 03:07:53 -0800 (PST) X-Received: by 2002:a1f:2555:: with SMTP id l82mr1515140vkl.7.1644318473361; Tue, 08 Feb 2022 03:07:53 -0800 (PST) MIME-Version: 1.0 References: <164299573337.26253.7538614611220034049.stgit@noble.brown> <164299611278.26253.14950274629759580371.stgit@noble.brown> In-Reply-To: <164299611278.26253.14950274629759580371.stgit@noble.brown> From: Geert Uytterhoeven Date: Tue, 8 Feb 2022 12:07:42 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 09/23] MM: submit multipage reads for SWP_FS_OPS swap-space To: NeilBrown Cc: Trond Myklebust , Anna Schumaker , Chuck Lever , Andrew Morton , Mel Gorman , Christoph Hellwig , David Howells , "open list:NFS, SUNRPC, AND..." , Linux MM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf03.hostedemail.com: domain of geert.uytterhoeven@gmail.com designates 209.85.217.54 as permitted sender) smtp.mailfrom=geert.uytterhoeven@gmail.com X-Rspamd-Server: rspam03 X-Rspam-User: X-Stat-Signature: aj45cbfjbzhuhgfghkk7cd4shhkdcxp8 X-Rspamd-Queue-Id: 2CEBE20006 X-HE-Tag: 1644318475-45905 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: Hi Neil, On Mon, Jan 24, 2022 at 5:49 PM 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. > > Signed-off-by: NeilBrown Thanks for your patch! > --- a/mm/swap.h > +++ b/mm/swap.h > @@ -53,7 +62,8 @@ static inline unsigned int page_swap_flags(struct page *page) > return page_swap_info(page)->flags; > } > #else /* CONFIG_SWAP */ > -static inline int swap_readpage(struct page *page, bool do_poll) > +static inline int swap_readpage(struct page *page, bool do_poll, > + struct swap_iocb **plug); Bogus semicolon. > { > return 0; > } Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds