[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210927200302.GH9286@twin.jikos.cz>
Date: Mon, 27 Sep 2021 22:03:02 +0200
From: David Sterba <dsterba@...e.cz>
To: David Howells <dhowells@...hat.com>
Cc: Matthew Wilcox <willy@...radead.org>, hch@....de,
trond.myklebust@...marydata.com, Jens Axboe <axboe@...nel.dk>,
"Darrick J. Wong" <djwong@...nel.org>, linux-block@...r.kernel.org,
linux-xfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org, darrick.wong@...cle.com,
viro@...iv.linux.org.uk, jlayton@...nel.org,
torvalds@...ux-foundation.org, linux-nfs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 9/9] mm: Remove swap BIO paths and only use DIO paths
On Sat, Sep 25, 2021 at 04:36:42PM +0100, David Howells wrote:
> Matthew Wilcox <willy@...radead.org> 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);
> }
> }
>
>
> > 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.
Yes we still need it for btrfs. Besides checking the conditions similar
to what iomap_swapfile_activate does on the file itself, we need to
exclude other operations potentially changing the mapping on the level
of block groups. This is namely relocation, used to implement several
other things like resize or balance. There's an exclusion at the
beginning of btrfs_swap_activate. Right now I don't see how we could
make sure that the swapfile requirements would be satisfied without it.
Powered by blists - more mailing lists