diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-06-13 23:32:09 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-06-16 22:01:10 -0400 |
commit | cbf343c6ae8eac9d13a0cb8aa0d940ae0f9884be (patch) | |
tree | b8312416231d924b2b6c7ab3b16db49d8766b1f4 | |
parent | 3c960be12d5c9a566846861a4e9267789c157d4c (diff) |
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 <kent.overstreet@gmail.com>
-rw-r--r-- | fs/bcachefs/alloc_background.c | 1 | ||||
-rw-r--r-- | fs/bcachefs/bcachefs_format.h | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index 288018fb4c48..b10b02307e1f 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 dbe9a37fcd41..7398b36467a2 100644 --- a/fs/bcachefs/bcachefs_format.h +++ b/fs/bcachefs/bcachefs_format.h @@ -1326,7 +1326,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, |