diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-03-02 01:54:17 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:55 -0400 |
commit | e84face6f0c9512d896eb1bf6c8238ea2fa7edd0 (patch) | |
tree | 802f0dde21c3311cf7a0245f379e0f1d2450bc29 /fs/bcachefs/buckets.h | |
parent | d57c9add59b187a6fcd76cb80d60f36234ca8033 (diff) | |
download | linux-stable-e84face6f0c9512d896eb1bf6c8238ea2fa7edd0.tar.gz linux-stable-e84face6f0c9512d896eb1bf6c8238ea2fa7edd0.tar.bz2 linux-stable-e84face6f0c9512d896eb1bf6c8238ea2fa7edd0.zip |
bcachefs: RESERVE_stripe
Rework stripe creation path - new algorithm for deciding when to create
new stripes or reuse existing stripes.
We add a new allocation watermark, RESERVE_stripe, above RESERVE_none.
Then we always try to create a new stripe by doing RESERVE_stripe
allocations; if this fails, we reuse an existing stripe and allocate
buckets for it with the reserve watermark for the given write
(RESERVE_none or RESERVE_movinggc).
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets.h')
-rw-r--r-- | fs/bcachefs/buckets.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/buckets.h b/fs/bcachefs/buckets.h index 22721bfea414..d677b0225c52 100644 --- a/fs/bcachefs/buckets.h +++ b/fs/bcachefs/buckets.h @@ -157,6 +157,9 @@ static inline u64 bch2_dev_buckets_reserved(struct bch_dev *ca, enum alloc_reser switch (reserve) { case RESERVE_NR: unreachable(); + case RESERVE_stripe: + reserved += ca->mi.nbuckets >> 6; + fallthrough; case RESERVE_none: reserved += ca->mi.nbuckets >> 6; fallthrough; |