bcachefs: Don't use BTREE_INSERT_USE_RESERVE so much
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 21 Dec 2020 22:17:18 +0000 (17:17 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:50 +0000 (17:08 -0400)
commit3187aa8d57025f60f1b8f9e14b6fc33f5e2d2960
tree4d0420f08e3d899fbbb35b388a04c33d564b3628
parentf0e70018d14ef94a5f680c977591ccb6cf29e9ca
bcachefs: Don't use BTREE_INSERT_USE_RESERVE so much

Previously, we were using BTREE_INSERT_RESERVE in a lot of places where
it no longer makes sense.

 - we now have more open_buckets than we used to, and the reserves work
   better, so we shouldn't need to use BTREE_INSERT_RESERVE just because
   we're holding open_buckets pinned anymore.

 - We have the btree key cache for updates to the alloc btree, meaning
   we no longer need the btree reserve to ensure the allocator can make
   forward progress.

This means that we should only need a reserve for btree updates to
ensure that copygc can make forward progress.

Since it's now just for copygc, we can also fold RESERVE_BTREE into
RESERVE_MOVINGGC (the allocator's freelist reserve).

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
15 files changed:
fs/bcachefs/alloc_background.c
fs/bcachefs/alloc_foreground.c
fs/bcachefs/alloc_types.h
fs/bcachefs/btree_gc.c
fs/bcachefs/btree_key_cache.c
fs/bcachefs/btree_update.h
fs/bcachefs/btree_update_interior.c
fs/bcachefs/btree_update_leaf.c
fs/bcachefs/buckets.c
fs/bcachefs/ec.c
fs/bcachefs/io.c
fs/bcachefs/journal.c
fs/bcachefs/move.c
fs/bcachefs/movinggc.c
fs/bcachefs/sysfs.c