bcachefs: Prep work for variable size btree node buffers
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 16 Jan 2024 18:29:59 +0000 (13:29 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 21 Jan 2024 18:27:10 +0000 (13:27 -0500)
commitec4edd7b9d2038a97e0ba3fad8fc8492b0d12d35
tree2ba47c4de8460460489d335e3f562eab8819ce96
parent2acc59dd88d27ad69b66ded80df16c042b04eeec
bcachefs: Prep work for variable size btree node buffers

bcachefs btree nodes are big - typically 256k - and btree roots are
pinned in memory. As we're now up to 18 btrees, we now have significant
memory overhead in mostly empty btree roots.

And in the future we're going to start enforcing that certain btree node
boundaries exist, to solve lock contention issues - analagous to XFS's
AGIs.

Thus, we need to start allocating smaller btree node buffers when we
can. This patch changes code that refers to the filesystem constant
c->opts.btree_node_size to refer to the btree node buffer size -
btree_buf_bytes() - where appropriate.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
18 files changed:
fs/bcachefs/backpointers.c
fs/bcachefs/backpointers.h
fs/bcachefs/bcachefs.h
fs/bcachefs/bset.c
fs/bcachefs/bset.h
fs/bcachefs/btree_cache.c
fs/bcachefs/btree_cache.h
fs/bcachefs/btree_io.c
fs/bcachefs/btree_trans_commit.c
fs/bcachefs/btree_update_interior.c
fs/bcachefs/btree_update_interior.h
fs/bcachefs/btree_write_buffer.c
fs/bcachefs/debug.c
fs/bcachefs/extents.c
fs/bcachefs/move.c
fs/bcachefs/super.c
fs/bcachefs/sysfs.c
fs/bcachefs/trace.h