linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* VFS caching of file extents
@ 2024-08-28 19:34 Matthew Wilcox
  2024-08-28 19:46 ` Chuck Lever
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Matthew Wilcox @ 2024-08-28 19:34 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: Dave Chinner, Darrick J. Wong, Christoph Hellwig, Chuck Lever,
	Jan Kara

Today it is the responsibility of each filesystem to maintain the mapping
from file logical addresses to disk blocks (*).  There are various ways
to query that information, eg calling get_block() or using iomap.

What if we pull that information up into the VFS?  Filesystems obviously
_control_ that information, so need to be able to invalidate entries.
And we wouldn't want to store all extents in the VFS all the time, so
would need to have a way to call into the filesystem to populate ranges
of files.  We'd need to decide how to lock/protect that information
-- a per-file lock?  A per-extent lock?  No locking, just a seqcount?
We need a COW bit in the extent which tells the user that this extent
is fine for reading through, but if there's a write to be done then the
filesystem needs to be asked to create a new extent.

There are a few problems I think this can solve.  One is efficient
implementation of NFS READPLUS.  Another is the callback from iomap
to the filesystem when doing buffered writeback.  A third is having a
common implementation of FIEMAP.  I've heard rumours that FUSE would like
something like this, and maybe there are other users that would crop up.

Anyway, this is as far as my thinking has got on this topic for now.
Maybe there's a good idea here, maybe it's all a huge overengineered mess
waiting to happen.  I'm sure other people know this area of filesystems
better than I do.

(*) For block device filesystems.  Obviously network filesystems and
synthetic filesystems don't care and can stop reading now.  Umm, unless
maybe they _want_ to use it, eg maybe there's a sharded thing going on and
the fs wants to store information about each shard in the extent cache?

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-08-29 22:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 19:34 VFS caching of file extents Matthew Wilcox
2024-08-28 19:46 ` Chuck Lever
2024-08-28 19:50   ` Matthew Wilcox
2024-08-29  6:05     ` Dave Chinner
2024-08-28 20:30 ` Josef Bacik
2024-08-28 23:46 ` Dave Chinner
2024-08-29  1:57 ` Darrick J. Wong
2024-08-29  4:00   ` Christoph Hellwig
2024-08-29 13:52     ` Chuck Lever III
2024-08-29 22:36       ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).