mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
bcachefs: Add a persistent counter for bucket invalidation
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
parent
0e96f5dcd7
commit
440c15cc91
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user