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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51B44C433F5 for ; Tue, 16 Nov 2021 21:46:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DF9CA61A64 for ; Tue, 16 Nov 2021 21:46:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DF9CA61A64 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 7B59E6B0072; Tue, 16 Nov 2021 16:46:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 73E066B0073; Tue, 16 Nov 2021 16:46:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5DE7C6B0074; Tue, 16 Nov 2021 16:46:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0087.hostedemail.com [216.40.44.87]) by kanga.kvack.org (Postfix) with ESMTP id 4CB766B0072 for ; Tue, 16 Nov 2021 16:46:32 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 0D7FA18216AE7 for ; Tue, 16 Nov 2021 21:46:22 +0000 (UTC) X-FDA: 78816127404.04.F931C23 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf25.hostedemail.com (Postfix) with ESMTP id 12145B00019B for ; Tue, 16 Nov 2021 21:46:07 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 54BE31FD37; Tue, 16 Nov 2021 21:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1637099180; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c/L9KoKoaxSnL1Jn59yhmyWCrQE61s5MuhLMctoNPdU=; b=RgzNBBALsJ0q2yi+k2olZ09hFBSCYQFALEp/JjAQDq4nLpSfYjvvHEg/Rm9JLSsbPvmYIs X1evb7fGBb8VJfZEYPFkOMAiTGB3YXTFqpRDKvTtVMmoYY0R7t2eFXRqWtnrXdxxnMfzkg 7IG93MR8RpuFfCBsFoXHmz4cMLRBtpQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1637099180; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c/L9KoKoaxSnL1Jn59yhmyWCrQE61s5MuhLMctoNPdU=; b=e+eCzDrgx+fAWEyBwRLIBGiZi7tt3MdyveQGsQYTzDZEZFb0WOrqhV0aryshHyw5hHZAhx tDlLcC5pWj2rVHAQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 70BAB13C5E; Tue, 16 Nov 2021 21:46:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id C1WzC6kmlGG1IAAAMHmgww (envelope-from ); Tue, 16 Nov 2021 21:46:17 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: "NeilBrown" To: "Christoph Hellwig" Cc: "Trond Myklebust" , "Anna Schumaker" , "Chuck Lever" , "Andrew Morton" , "Mel Gorman" , linux-nfs@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org Subject: Re: [PATCH 12/13] MM: use AIO/DIO for reads from SWP_FS_OPS swap-space In-reply-to: References: <163702956672.25805.16457749992977493579.stgit@noble.brown>, <163703064458.25805.6777856691611196478.stgit@noble.brown>, Date: Wed, 17 Nov 2021 08:46:14 +1100 Message-id: <163709917463.13692.6685266362531701682@noble.neil.brown.name> X-Rspamd-Queue-Id: 12145B00019B X-Stat-Signature: hz7ff7siper196sh4au4a76ma8yczs3p Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=RgzNBBAL; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=e+eCzDrg; spf=pass (imf25.hostedemail.com: domain of neilb@suse.de designates 195.135.220.29 as permitted sender) smtp.mailfrom=neilb@suse.de; dmarc=pass (policy=none) header.from=suse.de X-Rspamd-Server: rspam02 X-HE-Tag: 1637099167-571894 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 Tue, 16 Nov 2021, Christoph Hellwig wrote: > On Tue, Nov 16, 2021 at 01:44:04PM +1100, NeilBrown wrote: > > When pages a read from SWP_FS_OPS swap-space, the reads are submitted as > > separate reads for each page. This is generally less efficient than > > larger reads. > >=20 > > We can use the block-plugging infrastructure to delay submitting the > > read request until multiple contigious pages have been collected. This > > requires using ->direct_IO to submit the read (as ->readpages isn't > > suitable for swap). >=20 > Abusing the block code here seems little ugly. Also this won't > compile if CONFIG_BLOCK is not set, will it? There is nothing really block-layer-specific about the plugging interfaces. I think it would be quite reasonable to move them to lib/ But you are correct that currently without CONFIG_BLOCK the code will compile but not work. >=20 > What is the problem with just batching up manually? That would require a bigger change to common code, which would only benefit one user. The plugging mechanism works well for batching requests to a block device. Why not use it for non-block-devices too? Thanks, NeilBrown >=20 > > + /* nofs needs as ->direct_IO may take the same mutex it takes for write= */ >=20 > Overly long line. >=20 >=20