bcachefs: Don't inc io_(read|write) counters for moves

This makes 'bcachefs fs top' more useful; we can now see at a glance
whether the IO to the device is being done for user reads/writes, or
copygc/rebalance.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2025-01-30 03:41:31 -05:00
parent e5a63ad343
commit 55a132c37a
2 changed files with 4 additions and 2 deletions

View File

@ -1091,7 +1091,8 @@ int __bch2_read_extent(struct btree_trans *trans, struct bch_read_bio *orig,
if (rbio->bounce)
trace_and_count(c, read_bounce, &rbio->bio);
this_cpu_add(c->counters[BCH_COUNTER_io_read], bio_sectors(&rbio->bio));
if (!(flags & BCH_READ_NODECODE))
this_cpu_add(c->counters[BCH_COUNTER_io_read], bio_sectors(&rbio->bio));
bch2_increment_clock(c, bio_sectors(&rbio->bio), READ);
/*

View File

@ -1644,7 +1644,8 @@ CLOSURE_CALLBACK(bch2_write)
goto err;
}
this_cpu_add(c->counters[BCH_COUNTER_io_write], bio_sectors(bio));
if (!(op->flags & BCH_WRITE_MOVE))
this_cpu_add(c->counters[BCH_COUNTER_io_write], bio_sectors(bio));
bch2_increment_clock(c, bio_sectors(bio), WRITE);
data_len = min_t(u64, bio->bi_iter.bi_size,