diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-16 13:29:59 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-21 13:27:10 -0500 |
commit | ec4edd7b9d2038a97e0ba3fad8fc8492b0d12d35 (patch) | |
tree | 2ba47c4de8460460489d335e3f562eab8819ce96 /fs/bcachefs/backpointers.c | |
parent | 2acc59dd88d27ad69b66ded80df16c042b04eeec (diff) | |
download | linux-stable-ec4edd7b9d2038a97e0ba3fad8fc8492b0d12d35.tar.gz linux-stable-ec4edd7b9d2038a97e0ba3fad8fc8492b0d12d35.tar.bz2 linux-stable-ec4edd7b9d2038a97e0ba3fad8fc8492b0d12d35.zip |
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>
Diffstat (limited to 'fs/bcachefs/backpointers.c')
-rw-r--r-- | fs/bcachefs/backpointers.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/backpointers.c b/fs/bcachefs/backpointers.c index bf828f1f28d2..b4dc319bcb2b 100644 --- a/fs/bcachefs/backpointers.c +++ b/fs/bcachefs/backpointers.c @@ -560,7 +560,7 @@ static size_t btree_nodes_fit_in_ram(struct bch_fs *c) si_meminfo(&i); mem_bytes = i.totalram * i.mem_unit; - return div_u64(mem_bytes >> 1, btree_bytes(c)); + return div_u64(mem_bytes >> 1, c->opts.btree_node_size); } static int bch2_get_btree_in_memory_pos(struct btree_trans *trans, |