bcachefs: BCH_WATERMARK_reclaim
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 27 Jun 2023 21:29:20 +0000 (17:29 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:10:05 +0000 (17:10 -0400)
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>
fs/bcachefs/alloc_foreground.c
fs/bcachefs/alloc_types.h
fs/bcachefs/buckets.h

index c7db89b..0cc5e9f 100644 (file)
@@ -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;
        }
index a01fddf..ddcaf06 100644 (file)
@@ -17,6 +17,7 @@ struct bucket_alloc_state {
 };
 
 #define BCH_WATERMARKS()               \
+       x(reclaim)                      \
        x(btree_copygc)                 \
        x(btree)                        \
        x(copygc)                       \
index 803780d..f9d7dda 100644 (file)
@@ -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;
        }