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 80A02C433F5 for ; Tue, 21 Dec 2021 08:34:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C7BB46B0074; Tue, 21 Dec 2021 03:34:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C2BE66B0075; Tue, 21 Dec 2021 03:34:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AF3956B0078; Tue, 21 Dec 2021 03:34:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0037.hostedemail.com [216.40.44.37]) by kanga.kvack.org (Postfix) with ESMTP id 9D7E96B0074 for ; Tue, 21 Dec 2021 03:34:26 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 59C5A8249980 for ; Tue, 21 Dec 2021 08:34:26 +0000 (UTC) X-FDA: 78941139732.13.CCC36F1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf03.hostedemail.com (Postfix) with ESMTP id 97BAA20015 for ; Tue, 21 Dec 2021 08:34:25 +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=wXxR6SYYaV50yiBcuWHvs/ZYV9MStEaOVKcAB5B0IYc=; b=31JjlRoTGlsAzO9y1xYYeo8PCa 1uxLTvHcSOFgoDaNWWXx8N2sKe0uZBytxNJ6Uw3Dwwe2/1Xz8MKdAp880AlfNIFbx5CeQqpir4LhJ ZV5wO8HGOGJcprM47XASQH5KEOV3Ba//lObUD7hV09nCp13zu0fnAfVlU/m1k32Sby1Hc8drX1/52 T9wfUCBfpJV5X+zq6CrqmwE9f32wqlcrL5/hKn9L9/2LHYv3vvZOFnMJ2zN5gXe4HvS46MOugDyeB 6lejy89eeotvzbKo1CHPxl8V6rAlR1hEbWE2IjlpX1cHFUoQJ9IdVDjAaiti5i0Po6mgVIbcvqDLJ y1NzKe0A==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzab9-005xBS-Li; Tue, 21 Dec 2021 08:34:15 +0000 Date: Tue, 21 Dec 2021 00:34:15 -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 01/18] Structural cleanup for filesystem-based swap Message-ID: References: <163969801519.20885.3977673503103544412.stgit@noble.brown> <163969850251.20885.10819272484905153807.stgit@noble.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <163969850251.20885.10819272484905153807.stgit@noble.brown> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Queue-Id: 97BAA20015 X-Stat-Signature: m5761m6hg8fj8jryxjhsbbycgttiz3jm Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=31JjlRoT; dmarc=none; spf=none (imf03.hostedemail.com: domain of BATV+1bb9050bde7847c37d79+6694+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+1bb9050bde7847c37d79+6694+infradead.org+hch@bombadil.srs.infradead.org X-Rspamd-Server: rspam02 X-HE-Tag: 1640075665-53975 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 Fri, Dec 17, 2021 at 10:48:22AM +1100, NeilBrown wrote: > Linux primarily uses IO to block devices for swap, but can send the IO > requests to a filesystem. This has only ever worked for NFS, and that > hasn't worked for a while due to a lack of testing. This seems like a > good time for some tidy-up before restoring swap-over-NFS functionality. The changes look good to me, but I think this needs to be split into separate, self-contained patches. > > This patch: Patch 1: > - updates the documentation (both copies!) for swap_activate which > is woefully out-of-date Patch 2: > - drops the call to the filesystem for ->set_page_dirty(). These > pages do not belong to the filesystem, and it has no interest > in the dirty status. Patch 3: > - move the responsibility for setting SWP_FS_OPS to ->swap_activate() > and also requires it to always call add_swap_extent(). This makes > it much easier to find filesystems that require SWP_FS_OPS. Patch 4: > - introduces a new address_space operation "swap_rw" for swap IO. > The code currently used ->readpage for reads and ->direct_IO for > writes. The former imposes a limit of one-page-at-a-time, the > later means that direct writes and swap writes are encouraged to > use the same path. While similar, swap can often be simpler as > it can assume that no allocation is needed, and coherence with the > page cache is irrelevant.