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 0AF60C433EF for ; Tue, 16 Nov 2021 08:32:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 199BA611ED for ; Tue, 16 Nov 2021 08:32:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 199BA611ED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 874FC6B0089; Tue, 16 Nov 2021 03:32:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 824956B008A; Tue, 16 Nov 2021 03:32:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7135B6B008C; Tue, 16 Nov 2021 03:32:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0118.hostedemail.com [216.40.44.118]) by kanga.kvack.org (Postfix) with ESMTP id 5EFD46B0089 for ; Tue, 16 Nov 2021 03:32:08 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2052E853F7 for ; Tue, 16 Nov 2021 08:32:08 +0000 (UTC) X-FDA: 78814125936.13.5DD9D08 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf25.hostedemail.com (Postfix) with ESMTP id D02B6B0002A8 for ; Tue, 16 Nov 2021 08:31: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=fiwmf+S4eS/bBuUt94ax6RoYl4bLvkHz0Y7NqOMkkK8=; b=ePoP4KeW6qvLcFkQYEz6yGWYtB XYrkDUawFpJc4ANK/rpBwY/OcdHnAMxlZa7YTc3cZyv+Cm38lHNP5h7BCHQ5MYgeWPIqbDGSiUysm 3s7WK48Kc2fsdBXYcqlndJ/b8fHZ3foNJEjuDwVE/D+ghpy//wu2sVupecCayXRAZ2mk96FJm8NDg nvEz/dzeq14Jt2ELJXdpj/nzQ4BhjFSBE6F7nH8Dy1zeatPYQ5ITNQ8HfpQ3laoGY8vrNh9+bqG02 dv3yU3IyeEmTvaMJbOGALwsd/7gDdTipt5n3oa58TFrcI4Q2R1Bb8fD4Z7F9cLY6OhQKclX/FEQ6B Z9pIJb9w==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mmtsl-000jx1-Hf; Tue, 16 Nov 2021 08:31:59 +0000 Date: Tue, 16 Nov 2021 00:31:59 -0800 From: Christoph Hellwig To: NeilBrown 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 Message-ID: References: <163702956672.25805.16457749992977493579.stgit@noble.brown> <163703064458.25805.6777856691611196478.stgit@noble.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <163703064458.25805.6777856691611196478.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: 34nq9r17751sgkon56huyq895nu6h6xi Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=ePoP4KeW; spf=none (imf25.hostedemail.com: domain of BATV+fc0a9848db96d791f48c+6659+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+fc0a9848db96d791f48c+6659+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: D02B6B0002A8 X-HE-Tag: 1637051511-121422 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, 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. > > 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). Abusing the block code here seems little ugly. Also this won't compile if CONFIG_BLOCK is not set, will it? What is the problem with just batching up manually? > + /* nofs needs as ->direct_IO may take the same mutex it takes for write */ Overly long line.