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 DB388C433EF for ; Sat, 25 Sep 2021 17:11:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5BF5660FDC for ; Sat, 25 Sep 2021 17:11:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5BF5660FDC 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 63F47900002; Sat, 25 Sep 2021 13:11:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5EEA66B0072; Sat, 25 Sep 2021 13:11:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4DD25900002; Sat, 25 Sep 2021 13:11:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id 4182F6B0071 for ; Sat, 25 Sep 2021 13:11:03 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id DED28180ACC3C for ; Sat, 25 Sep 2021 17:11:02 +0000 (UTC) X-FDA: 78626735964.26.29BF9F8 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf29.hostedemail.com (Postfix) with ESMTP id 4C67A9000163 for ; Sat, 25 Sep 2021 17:11:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=6GW8m99cwWwrKJpThjZDb6GAcdSzWmr59+OAVUULh/4=; b=wIJ/z5Pf4qc/NRbdHahqEcKlFh xi7rk3SB+eFCQsAivXx/SZlAI3nZ1B+Gexsbziymg38NFlt+qNOeNhfDFGS7WNpoy9P6lPKzYF3lM QIIMcZWj6sSt6VCo3rctoO1eExcMHzmgXDygsJmbQlPKeaKyb2UzmvXKCjpcWtRhEFCg8pxiaiV5c g3cm7c8o/yMJ2MKP+jYoEaHx/i5AP2faYXraXpMpk9DxZ+VDQj7kYDpdzFLJ41tZdkDFSed6UuGez zxyg/1q8QZPXx5qrAPb5K6iborPgrk3HHDUXxBVim2uGXeZ/jq7QixuVz65AY2QlRgJRB5l0aNark jbWVBjwA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mUBBK-008GPg-Vk; Sat, 25 Sep 2021 17:09:55 +0000 Date: Sat, 25 Sep 2021 18:09:46 +0100 From: Matthew Wilcox To: David Howells Cc: hch@lst.de, trond.myklebust@primarydata.com, Jens Axboe , "Darrick J. Wong" , linux-block@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, darrick.wong@oracle.com, viro@zeniv.linux.org.uk, jlayton@kernel.org, torvalds@linux-foundation.org, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 9/9] mm: Remove swap BIO paths and only use DIO paths Message-ID: References: <163250387273.2330363.13240781819520072222.stgit@warthog.procyon.org.uk> <163250396319.2330363.10564506508011638258.stgit@warthog.procyon.org.uk> <2396106.1632584202@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2396106.1632584202@warthog.procyon.org.uk> X-Rspamd-Queue-Id: 4C67A9000163 X-Stat-Signature: sp1cxhxg8pswa37skchgr7w4om3aqw6y Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="wIJ/z5Pf"; spf=none (imf29.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam06 X-HE-Tag: 1632589862-791468 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 Sat, Sep 25, 2021 at 04:36:42PM +0100, David Howells wrote: > Matthew Wilcox wrote: > > > On Fri, Sep 24, 2021 at 06:19:23PM +0100, David Howells wrote: > > > Delete the BIO-generating swap read/write paths and always use ->swap_rw(). > > > This puts the mapping layer in the filesystem. > > > > Is SWP_FS_OPS now unused after this patch? > > Ummm. Interesting question - it's only used in swap_set_page_dirty(): > > int swap_set_page_dirty(struct page *page) > { > struct swap_info_struct *sis = page_swap_info(page); > > if (data_race(sis->flags & SWP_FS_OPS)) { > struct address_space *mapping = sis->swap_file->f_mapping; > > VM_BUG_ON_PAGE(!PageSwapCache(page), page); > return mapping->a_ops->set_page_dirty(page); > } else { > return __set_page_dirty_no_writeback(page); > } > } I suspect that's no longer necessary. NFS was the only filesystem using SWP_FS_OPS and ... fs/nfs/file.c: .set_page_dirty = __set_page_dirty_nobuffers, so it's not like NFS does anything special to reserve memory to write back swap pages. > > Also, do we still need ->swap_activate and ->swap_deactivate? > > f2fs does quite a lot of work in its ->swap_activate(), as does btrfs. I'm > not sure how necessary it is. cifs looks like it intends to use it, but it's > not fully implemented yet. zonefs and nfs do some checking, including hole > checking in nfs's case. nfs also does some setting up for the sunrpc > transport. > > btrfs, cifs, f2fs and nfs all supply ->swap_deactivate() to undo the effects > of the activation. Right ... so my question really is, now that we're doing I/O through aops->direct_IO (or ->swap_rw), do those magic things need to be done? After all, open(O_DIRECT) doesn't do these same magic things. They're really there to allow the direct-to-BIO path to work, and you're removing that here.