[PATCHSET RFC v2 chandan 0/4] xfs: separate btree cursor slab zones

Darrick J. Wong
2021-09-24T01:27:39Z

Hi all,

Following the review discussions about the dynamic btree cursor height
patches, I've throw together another series to reduce the size of the
btree cursor, compute the absolute maximum possible btree heights for
each btree type, and now each btree cursor has its own slab zone:

$ grep xfs.*cur /proc/slabinfo
xfs_refc_btree_cur 0 0 192 21 1 : tunables 0 0 0 : slabdata 0 0 0
xfs_ialloc_btree_cur 0 0 208 19 1 : tunables 0 0 0 : slabdata 0 0 0
xfs_bmap_btree_cur 0 0 240 17 1 : tunables 0 0 0 : slabdata 0 0 0
xfs_rmap_btree_cur 0 0 240 17 1 : tunables 0 0 0 : slabdata 0 0 0
xfs_alloc_btree_cur 0 0 208 19 1 : tunables 0 0 0 : slabdata 0 0 0

I've also rigged up the debugger to make it easier to extract the actual
height information:

$ xfs_db /dev/sda -c 'btheight -w absmax all'
bnobt: 7
cntbt: 7
inobt: 7
finobt: 7
bmapbt: 9
refcountbt: 6
rmapbt: 9

As you can see from the slabinfo output, this no longer means that we're
allocating 224-byte cursors for all five btree types. Even with the
extra overhead of supporting dynamic cursor sizes, we still come out
ahead in terms of cursor size for three of the five btree types.

This series also includes a couple of patches to reduce holes and
unnecessary fields in the btree cursor.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything. 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=btree-cursor-zones-5.16
---
fs/xfs/libxfs/xfs_alloc_btree.c | 12 +++++++
fs/xfs/libxfs/xfs_alloc_btree.h | 1 +
fs/xfs/libxfs/xfs_bmap_btree.c | 13 ++++++++
fs/xfs/libxfs/xfs_bmap_btree.h | 1 +
fs/xfs/libxfs/xfs_btree.c | 61 +++++++++++++++++++++++++++++++----
fs/xfs/libxfs/xfs_btree.h | 28 +++++++++-------
fs/xfs/libxfs/xfs_fs.h | 3 ++
fs/xfs/libxfs/xfs_ialloc_btree.c | 11 ++++++
fs/xfs/libxfs/xfs_ialloc_btree.h | 1 +
fs/xfs/libxfs/xfs_refcount_btree.c | 13 ++++++++
fs/xfs/libxfs/xfs_refcount_btree.h | 1 +
fs/xfs/libxfs/xfs_rmap_btree.c | 25 +++++++++++++++
fs/xfs/libxfs/xfs_rmap_btree.h | 1 +
fs/xfs/libxfs/xfs_types.h | 3 ++
fs/xfs/xfs_super.c | 62 +++++++++++++++++++++++++++++++++---
15 files changed, 210 insertions(+), 26 deletions(-)