diff options
| author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-01-30 03:41:31 -0500 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-03-14 21:02:10 -0400 |
| commit | 55a132c37acded02391664c108fcea5006c72fd5 (patch) | |
| tree | b03b9cfcc4c12eb71a7e18f3cedc0bcb57b5b0fb | |
| parent | bcachefs: Fix missing increment of move_extent_write counter (diff) | |
| download | linux-55a132c37acded02391664c108fcea5006c72fd5.tar.gz linux-55a132c37acded02391664c108fcea5006c72fd5.zip | |
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>
| -rw-r--r-- | fs/bcachefs/io_read.c | 3 | ||||
| -rw-r--r-- | fs/bcachefs/io_write.c | 3 |
2 files changed, 4 insertions, 2 deletions
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, |
