diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-12-21 17:17:18 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:50 -0400 |
commit | 3187aa8d57025f60f1b8f9e14b6fc33f5e2d2960 (patch) | |
tree | 4d0420f08e3d899fbbb35b388a04c33d564b3628 /fs/bcachefs/alloc_types.h | |
parent | f0e70018d14ef94a5f680c977591ccb6cf29e9ca (diff) | |
download | linux-3187aa8d57025f60f1b8f9e14b6fc33f5e2d2960.tar.gz linux-3187aa8d57025f60f1b8f9e14b6fc33f5e2d2960.tar.bz2 linux-3187aa8d57025f60f1b8f9e14b6fc33f5e2d2960.zip |
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>
Diffstat (limited to 'fs/bcachefs/alloc_types.h')
-rw-r--r-- | fs/bcachefs/alloc_types.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/bcachefs/alloc_types.h b/fs/bcachefs/alloc_types.h index 20705460bb0a..a510ca9a295b 100644 --- a/fs/bcachefs/alloc_types.h +++ b/fs/bcachefs/alloc_types.h @@ -37,11 +37,9 @@ struct bucket_clock { /* There is one reserve for each type of btree, one for prios and gens * and one for moving GC */ enum alloc_reserve { - RESERVE_ALLOC = -1, - RESERVE_BTREE = 0, - RESERVE_MOVINGGC = 1, - RESERVE_NONE = 2, - RESERVE_NR = 3, + RESERVE_MOVINGGC = 0, + RESERVE_NONE = 1, + RESERVE_NR = 2, }; typedef FIFO(long) alloc_fifo; |