From: Kent Overstreet Date: Thu, 30 Jan 2025 08:41:31 +0000 (-0500) Subject: bcachefs: Don't inc io_(read|write) counters for moves X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=55a132c37acded02391664c108fcea5006c72fd5;p=users%2Fwilly%2Flinux.git 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 --- diff --git a/fs/bcachefs/io_read.c b/fs/bcachefs/io_read.c index aa91fcf51eec..b2b0280d8365 100644 --- a/fs/bcachefs/io_read.c +++ b/fs/bcachefs/io_read.c @@ -1091,7 +1091,8 @@ get_bio: 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); /* diff --git a/fs/bcachefs/io_write.c b/fs/bcachefs/io_write.c index 03892388832b..970f3f0959a4 100644 --- a/fs/bcachefs/io_write.c +++ b/fs/bcachefs/io_write.c @@ -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,