[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YU/ks7Sfw5Wj0K1p@casper.infradead.org>
Date: Sun, 26 Sep 2021 04:10:43 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Dave Chinner <david@...morbit.com>
Cc: David Howells <dhowells@...hat.com>, hch@....de,
trond.myklebust@...marydata.com, Theodore Ts'o <tytso@....edu>,
linux-block@...r.kernel.org, ceph-devel@...r.kernel.org,
Trond Myklebust <trond.myklebust@...merspace.com>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
Jeff Layton <jlayton@...nel.org>,
Andreas Dilger <adilger.kernel@...ger.ca>,
Anna Schumaker <anna.schumaker@...app.com>, linux-mm@...ck.org,
Bob Liu <bob.liu@...cle.com>,
"Darrick J. Wong" <djwong@...nel.org>,
Josef Bacik <josef@...icpanda.com>,
Seth Jennings <sjenning@...ux.vnet.ibm.com>,
Jens Axboe <axboe@...nel.dk>, linux-fsdevel@...r.kernel.org,
linux-xfs@...r.kernel.org, linux-ext4@...r.kernel.org,
linux-cifs@...r.kernel.org, Chris Mason <clm@...com>,
David Sterba <dsterba@...e.com>,
Minchan Kim <minchan@...nel.org>,
Steve French <sfrench@...ba.org>, NeilBrown <neilb@...e.de>,
Dan Magenheimer <dan.magenheimer@...cle.com>,
linux-nfs@...r.kernel.org, Ilya Dryomov <idryomov@...il.com>,
linux-btrfs@...r.kernel.org, viro@...iv.linux.org.uk,
torvalds@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH v3 0/9] mm: Use DIO for swap and fix NFS swapfiles
On Sun, Sep 26, 2021 at 09:42:43AM +1000, Dave Chinner wrote:
> Ok, so if the filesystem is doing block mapping in the IO path now,
> why does the swap file still need to map the file into a private
> block mapping now? i.e all the work that iomap_swapfile_activate()
> does for filesystems like XFS and ext4 - it's this completely
> redundant now that we are doing block mapping during swap file IO
> via iomap_dio_rw()?
Hi Dave,
Thanks for bringing up all these points. I think they all deserve to go
into the documentation as "things to consider" for people implementing
->swap_rw for their filesystem.
Something I don't think David perhaps made sufficiently clear is that
regular DIO from userspace gets handled by ->read_iter and ->write_iter.
This ->swap_rw op is used exclusive for, as the name suggests, swap DIO.
So filesystems don't have to handle swap DIO and regular DIO the same
way, and can split the allocation work between ->swap_activate and the
iomap callback as they see fit (as long as they can guarantee the lack
of deadlocks under memory pressure).
There are several advantages to using the DIO infrastructure for
swap:
- unify block & net swap paths
- allow filesystems to _see_ swap IOs instead of being bypassed
- get rid of the swap extent rbtree
- allow writing compound pages to swap files instead of splitting
them
- allow ->readpage to be synchronous for better error reporting
- remove page_file_mapping() and page_file_offset()
I suspect there are several problems with this patchset, but I'm not
likely to have a chance to read it closely for a few days. If you
have time to give the XFS parts a good look, that would be fantastic.
Powered by blists - more mailing lists