[PATCHSET v29.0 26/28] xfs: cache xfile pages for better performance

Darrick J. Wong
2023-12-31T19:32:09Z

Hi all,

This patchset improves the performance of xfile-backed btrees by
teaching the buffer cache to directly map pages from the xfile. It also
speeds up xfarray operations substantially by implementing a small page
cache to avoid repeated kmap/kunmap calls. Collectively, these can
reduce the runtime of online repair functions by twenty percent or so.

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=xfile-page-caching

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=xfile-page-caching
---
fs/xfs/libxfs/xfs_btree_mem.h | 6 +
fs/xfs/libxfs/xfs_rmap_btree.c | 1
fs/xfs/scrub/rcbag_btree.c | 1
fs/xfs/scrub/trace.h | 44 ++++++
fs/xfs/scrub/xfbtree.c | 23 +++
fs/xfs/scrub/xfile.c | 307 ++++++++++++++++++++++++++--------------
fs/xfs/scrub/xfile.h | 23 +++
fs/xfs/xfs_buf.c | 116 ++++++++++++---
fs/xfs/xfs_buf.h | 16 ++
fs/xfs/xfs_buf_xfile.c | 173 +++++++++++++++++++++++
fs/xfs/xfs_buf_xfile.h | 11 +
11 files changed, 584 insertions(+), 137 deletions(-)