From: Kent Overstreet Date: Tue, 14 Jun 2022 03:32:09 +0000 (-0400) Subject: bcachefs: Add a persistent counter for bucket discards X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6f44a9940c600c5a0663b825bdd89aad0639e3a0;p=linux.git bcachefs: Add a persistent counter for bucket discards Like the previous patch for bucket invalidates, add another counter for a core allocator path. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index 543ec0c45883d..012607cefb6f6 100644 --- a/fs/bcachefs/alloc_background.c +++ b/fs/bcachefs/alloc_background.c @@ -1052,6 +1052,7 @@ static void bch2_do_discards_work(struct work_struct *work) if (ret) break; + this_cpu_inc(c->counters[BCH_COUNTER_bucket_discard]); discarded++; } bch2_trans_iter_exit(&trans, &iter); diff --git a/fs/bcachefs/bcachefs_format.h b/fs/bcachefs/bcachefs_format.h index 944cc6247a842..b9d614f608b5b 100644 --- a/fs/bcachefs/bcachefs_format.h +++ b/fs/bcachefs/bcachefs_format.h @@ -1330,7 +1330,8 @@ struct bch_sb_field_disk_groups { x(io_read, 0) \ x(io_write, 1) \ x(io_move, 2) \ - x(bucket_invalidate, 3) + x(bucket_invalidate, 3) \ + x(bucket_discard, 4) enum bch_persistent_counters { #define x(t, n, ...) BCH_COUNTER_##t,