diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-06-27 17:29:20 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:05 -0400 |
commit | 494036d862dfff1de9782492692da225479b7146 (patch) | |
tree | 9e056723d45792ab5c1621df755420d1e7a1f3a0 | |
parent | 2766876d5d118abd59d14fbe5b31e7e208ea11f2 (diff) |
bcachefs: BCH_WATERMARK_reclaim
Add another watermark for journal reclaim - this is needed for the next
patches, that unify BCH_WATERMARK with JOURNAL_WATERMARK.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/alloc_foreground.c | 6 | ||||
-rw-r--r-- | fs/bcachefs/alloc_types.h | 1 | ||||
-rw-r--r-- | fs/bcachefs/buckets.h | 1 |
3 files changed, 6 insertions, 2 deletions
diff --git a/fs/bcachefs/alloc_foreground.c b/fs/bcachefs/alloc_foreground.c index c7db89b92dbf..0cc5e9f8d461 100644 --- a/fs/bcachefs/alloc_foreground.c +++ b/fs/bcachefs/alloc_foreground.c @@ -191,11 +191,13 @@ long bch2_bucket_alloc_new_fs(struct bch_dev *ca) static inline unsigned open_buckets_reserved(enum bch_watermark watermark) { switch (watermark) { + case BCH_WATERMARK_reclaim: + return 0; case BCH_WATERMARK_btree: case BCH_WATERMARK_btree_copygc: - return 0; - case BCH_WATERMARK_copygc: return OPEN_BUCKETS_COUNT / 4; + case BCH_WATERMARK_copygc: + return OPEN_BUCKETS_COUNT / 3; default: return OPEN_BUCKETS_COUNT / 2; } diff --git a/fs/bcachefs/alloc_types.h b/fs/bcachefs/alloc_types.h index a01fddfba004..ddcaf0631a8b 100644 --- a/fs/bcachefs/alloc_types.h +++ b/fs/bcachefs/alloc_types.h @@ -17,6 +17,7 @@ struct bucket_alloc_state { }; #define BCH_WATERMARKS() \ + x(reclaim) \ x(btree_copygc) \ x(btree) \ x(copygc) \ diff --git a/fs/bcachefs/buckets.h b/fs/bcachefs/buckets.h index 803780d9b8b7..f9d7dda07ea6 100644 --- a/fs/bcachefs/buckets.h +++ b/fs/bcachefs/buckets.h @@ -170,6 +170,7 @@ static inline u64 bch2_dev_buckets_reserved(struct bch_dev *ca, enum bch_waterma reserved += ca->nr_btree_reserve; fallthrough; case BCH_WATERMARK_btree_copygc: + case BCH_WATERMARK_reclaim: break; } |