From: Kent Overstreet Date: Thu, 30 Jan 2025 08:33:16 +0000 (-0500) Subject: bcachefs: BCH_COUNTER_bucket_discard_fast X-Git-Tag: v6.15-rc1~146^2~171 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ee760f667e09b95a19beea265077eb2f69cd12b;p=thirdparty%2Fkernel%2Flinux.git bcachefs: BCH_COUNTER_bucket_discard_fast Add a separate counter for fastpath bucket discards, which don't require a journal flush. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index 3ea809990ef1a..43c29b0d2d205 100644 --- a/fs/bcachefs/alloc_background.c +++ b/fs/bcachefs/alloc_background.c @@ -1897,7 +1897,10 @@ commit: if (ret) goto out; - count_event(c, bucket_discard); + if (!fastpath) + count_event(c, bucket_discard); + else + count_event(c, bucket_discard_fast); out: fsck_err: if (discard_locked) diff --git a/fs/bcachefs/sb-counters_format.h b/fs/bcachefs/sb-counters_format.h index cb44d9ee1ac57..d0391c5d4c487 100644 --- a/fs/bcachefs/sb-counters_format.h +++ b/fs/bcachefs/sb-counters_format.h @@ -13,6 +13,7 @@ enum counters_flags { x(io_move, 2, TYPE_SECTORS) \ x(bucket_invalidate, 3, TYPE_COUNTER) \ x(bucket_discard, 4, TYPE_COUNTER) \ + x(bucket_discard_fast, 79, TYPE_COUNTER) \ x(bucket_alloc, 5, TYPE_COUNTER) \ x(bucket_alloc_fail, 6, TYPE_COUNTER) \ x(btree_cache_scan, 7, TYPE_COUNTER) \