[PATCHSET RFC v5 7/8] fuse: cache iomap mappings for even better file IO performance

Darrick J. Wong
2025-09-16T00:19:52Z

Hi all,

This series improves the performance (and correctness for some
filesystems) by adding the ability to cache iomap mappings in the
kernel. For filesystems that can change mapping states during pagecache
writeback (e.g. unwritten extent conversion) this is absolutely
necessary to deal with races with writes to the pagecache because
writeback does not take i_rwsem. For everyone else, it simply
eliminates roundtrips to userspace.

If you're going to start using this code, I strongly recommend pulling
from my git trees, which are linked below.

This has been running on the djcloud for months with no problems. Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=fuse-iomap-cache
---
Commits in this patchset:
* fuse: cache iomaps
* fuse_trace: cache iomaps
* fuse: use the iomap cache for iomap_begin
* fuse_trace: use the iomap cache for iomap_begin
* fuse: invalidate iomap cache after file updates
* fuse_trace: invalidate iomap cache after file updates
* fuse: enable iomap cache management
* fuse_trace: enable iomap cache management
* fuse: overlay iomap inode info in struct fuse_inode
* fuse: enable iomap
---
fs/fuse/fuse_i.h | 58 ++
fs/fuse/fuse_trace.h | 434 ++++++++++++
fs/fuse/iomap_priv.h | 149 ++++
include/uapi/linux/fuse.h | 33 +
fs/fuse/Makefile | 2
fs/fuse/dev.c | 44 +
fs/fuse/dir.c | 6
fs/fuse/file.c | 10
fs/fuse/file_iomap.c | 527 ++++++++++++++
fs/fuse/iomap_cache.c | 1693 +++++++++++++++++++++++++++++++++++++++++++++
10 files changed, 2937 insertions(+), 19 deletions(-)
create mode 100644 fs/fuse/iomap_cache.c