Commit 494036d8 authored by Kent Overstreet's avatar Kent Overstreet

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: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 2766876d
...@@ -191,11 +191,13 @@ long bch2_bucket_alloc_new_fs(struct bch_dev *ca) ...@@ -191,11 +191,13 @@ long bch2_bucket_alloc_new_fs(struct bch_dev *ca)
static inline unsigned open_buckets_reserved(enum bch_watermark watermark) static inline unsigned open_buckets_reserved(enum bch_watermark watermark)
{ {
switch (watermark) { switch (watermark) {
case BCH_WATERMARK_reclaim:
return 0;
case BCH_WATERMARK_btree: case BCH_WATERMARK_btree:
case BCH_WATERMARK_btree_copygc: case BCH_WATERMARK_btree_copygc:
return 0;
case BCH_WATERMARK_copygc:
return OPEN_BUCKETS_COUNT / 4; return OPEN_BUCKETS_COUNT / 4;
case BCH_WATERMARK_copygc:
return OPEN_BUCKETS_COUNT / 3;
default: default:
return OPEN_BUCKETS_COUNT / 2; return OPEN_BUCKETS_COUNT / 2;
} }
......
...@@ -17,6 +17,7 @@ struct bucket_alloc_state { ...@@ -17,6 +17,7 @@ struct bucket_alloc_state {
}; };
#define BCH_WATERMARKS() \ #define BCH_WATERMARKS() \
x(reclaim) \
x(btree_copygc) \ x(btree_copygc) \
x(btree) \ x(btree) \
x(copygc) \ x(copygc) \
......
...@@ -170,6 +170,7 @@ static inline u64 bch2_dev_buckets_reserved(struct bch_dev *ca, enum bch_waterma ...@@ -170,6 +170,7 @@ static inline u64 bch2_dev_buckets_reserved(struct bch_dev *ca, enum bch_waterma
reserved += ca->nr_btree_reserve; reserved += ca->nr_btree_reserve;
fallthrough; fallthrough;
case BCH_WATERMARK_btree_copygc: case BCH_WATERMARK_btree_copygc:
case BCH_WATERMARK_reclaim:
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment