Commit 440c15cc authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Add a persistent counter for bucket invalidation

Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 0e96f5dc
......@@ -1173,11 +1173,16 @@ static void bch2_do_invalidates_work(struct work_struct *work)
s64 nr_to_invalidate =
should_invalidate_buckets(ca, bch2_dev_usage_read(ca));
while (!ret && nr_to_invalidate-- >= 0)
while (nr_to_invalidate-- >= 0) {
ret = __bch2_trans_do(&trans, NULL, NULL,
BTREE_INSERT_USE_RESERVE|
BTREE_INSERT_NOFAIL,
invalidate_one_bucket(&trans, ca));
if (ret)
break;
this_cpu_inc(c->counters[BCH_COUNTER_bucket_invalidate]);
}
}
bch2_trans_exit(&trans);
......
......@@ -1326,10 +1326,11 @@ struct bch_sb_field_disk_groups {
/* BCH_SB_FIELD_counters */
#define BCH_PERSISTENT_COUNTERS() \
x(io_read, 0) \
x(io_write, 1) \
x(io_move, 2)
#define BCH_PERSISTENT_COUNTERS() \
x(io_read, 0) \
x(io_write, 1) \
x(io_move, 2) \
x(bucket_invalidate, 3)
enum bch_persistent_counters {
#define x(t, n, ...) BCH_COUNTER_##t,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment