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>
This commit is contained in:
Kent Overstreet 2022-06-13 23:32:09 -04:00 committed by Kent Overstreet
parent c9bd67321e
commit 6f44a9940c
2 changed files with 3 additions and 1 deletions

View File

@ -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);

View File

@ -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,