From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Dave Chinner <david@fromorbit.com>, Jan Kara <jack@suse.cz>,
"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [RFC 2/3] ext2: Convert ext2 regular file buffered I/O to use iomap
Date: Tue, 28 Nov 2023 21:37:21 -0800 [thread overview]
Message-ID: <20231129053721.GC36168@frogsfrogsfrogs> (raw)
In-Reply-To: <ZV76nfRd6BUzXYqe@infradead.org>
On Wed, Nov 22, 2023 at 11:09:17PM -0800, Christoph Hellwig wrote:
> On Wed, Nov 22, 2023 at 08:09:44PM -0800, Darrick J. Wong wrote:
> > The particular idea I had is to add a u64 counter to address_space that
> > we can bump in the same places where we bump xfs_inode_fork::if_seq
> > right now.. ->iomap_begin would sample this address_space::i_mappingseq
> > counter (with locks held), and now buffered writes and writeback can
> > check iomap::mappingseq == address_space::i_mappingseq to decide if it's
> > time to revalidate.
>
> So I think moving this to the VFS is probably a good idea, and I
> actually argued for that when the sequence checking was first proposed.
> We just have to be careful to be able to map things like the two
> separate data and cow seq counts in XFS (or anything else complicated
> in other file systems) to it.
TBH I've been wondering what would happen if we bumped i_mappingseq on
updates of either data or cow fork instead of the shift+or'd thing that
we use now for writeback and/or pagecache write.
I suppose the nice thing about the current encodings is that we elide
revalidations when the cow fork changes but mapping isn't shared.
> > Anyway, I'll have time to go play with that (and further purging of
> > function pointers)
>
> Do we have anything where the function pointer overhead is actually
> hurting us right now?
Not that I know of, but moving to a direct call model means that the fs
would know based on the iomap_XXX_iter function signature whether or not
iomap needs a srcmap; and then it can modify its iomap_begin function
accordingly.
Right now all those rules aren't especially obvious or well documented.
Maybe I can convince myself that improved documentation will suffice to
eliminate Ted's confusion. :)
Also I haven't checked how much the indirect calls hurt.
> One thing I'd like to move to is to merge the iomap_begin and iomap_end
> callbacks into one similar to willy's series from 2020. The big
Got a link to that? I need my memory refreshed, having DROP TABLE MEM2020;
pretty please.
> benefit of that would be that (together with switching
> write_cache_pages to an iterator model) that we could actually use
> this single iterator callback also for writeback instead of
> ->map_blocks, which doesn't really work with the current begin/end
> based iomap_iter as the folios actually written through
> write_cache_pages might not be contiguous.
Ooh it'd benice to get rid of that parallel callbacks thing finally.
> Using the same mapping
> callback would not only save some code duplication, but should also
> allow us to nicely implement Dave's old idea to not dirty pages for
> O_SYNC writes, but directly write them out. I did start prototyping
> that in the last days, and iomap_begin vs map_blocks is currently
> the biggest stumbling block.
Neat! willy's been pushing me for that too.
--D
next prev parent reply other threads:[~2023-11-29 5:37 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1700506526.git.ritesh.list@gmail.com>
2023-11-20 19:05 ` [RFC 1/3] ext2: Fix ki_pos update for DIO buffered-io fallback case Ritesh Harjani (IBM)
2023-11-21 4:39 ` Christoph Hellwig
2023-11-21 5:36 ` Ritesh Harjani
2023-11-22 6:51 ` Christoph Hellwig
2023-11-20 19:05 ` [RFC 2/3] ext2: Convert ext2 regular file buffered I/O to use iomap Ritesh Harjani (IBM)
2023-11-20 20:00 ` Matthew Wilcox
2023-11-21 4:44 ` Christoph Hellwig
2023-11-21 5:56 ` Ritesh Harjani
2023-11-21 6:08 ` Christoph Hellwig
2023-11-21 6:15 ` Ritesh Harjani
2023-11-22 12:29 ` Jan Kara
2023-11-22 13:11 ` Christoph Hellwig
2023-11-22 20:26 ` Ritesh Harjani
2023-11-30 3:24 ` Ritesh Harjani
2023-11-30 4:22 ` Matthew Wilcox
2023-11-30 4:37 ` Ritesh Harjani
2023-11-30 4:30 ` Christoph Hellwig
2023-11-30 5:27 ` Ritesh Harjani
2023-11-30 8:22 ` Zhang Yi
2023-11-30 7:45 ` Ritesh Harjani
2023-11-30 10:18 ` Jan Kara
2023-11-30 10:59 ` Ritesh Harjani
2023-11-30 14:08 ` Jan Kara
2023-11-30 15:50 ` Ritesh Harjani
2023-11-30 16:01 ` Jan Kara
2023-11-30 16:03 ` Matthew Wilcox
2023-12-01 23:09 ` Dave Chinner
2023-12-05 15:22 ` Ritesh Harjani
2023-12-07 8:58 ` Jan Kara
2023-11-22 22:26 ` Dave Chinner
2023-11-23 4:09 ` Darrick J. Wong
2023-11-23 7:09 ` Christoph Hellwig
2023-11-29 5:37 ` Darrick J. Wong [this message]
2023-11-29 6:32 ` Christoph Hellwig
2023-11-29 9:19 ` Dave Chinner
2023-11-23 7:02 ` Christoph Hellwig
2023-11-22 20:25 ` Ritesh Harjani
2023-11-20 19:05 ` [RFC 3/3] ext2: Enable large folio support Ritesh Harjani (IBM)
2023-11-20 20:00 ` Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231129053721.GC36168@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=ritesh.list@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.