summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2026-10-28 10:41:28 -0600
committerJens Axboe <axboe@kernel.dk>2026-10-28 15:40:34 -0600
commit587edb931fdda032bcd63fdfb0db4ded75159ee9 (patch)
tree7a8253b94464b6d40309db69e18afa47cafc1cb9 /block
parent020f61242d6ebeba5f8f2ef6e429aeffdd63f1c1 (diff)
downloadlinux-587edb931fdda032bcd63fdfb0db4ded75159ee9.tar.gz
linux-587edb931fdda032bcd63fdfb0db4ded75159ee9.zip
blk-throttle: pass the I/O counts of a dead group on
The recursive io_service_bytes and io_serviced files sum up the online groups plus what dead descendants left in aux_cnt. That worked while the counters lived in the blkg. Since commit 7ca464383aec they're in the throtl_grp and nobody passes them up, so the files go backwards when a child is removed. Add them to the parent in throtl_pd_offline(). Fixes: 7ca464383aec ("blk-throtl: stop using blkg->stat_bytes and ->stat_ios") Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Acked-by: Tejun Heo <tj@kernel.org> Link: https://patch.msgid.link/20261028164415.1262013-26-axboe@kernel.dk Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-throttle.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 4f10fe05744b..80a5e4b2872f 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -1670,7 +1670,18 @@ static void tg_flush_bios(struct throtl_grp *tg)
static void throtl_pd_offline(struct blkg_policy_data *pd)
{
- tg_flush_bios(pd_to_tg(pd));
+ struct throtl_grp *tg = pd_to_tg(pd);
+ struct throtl_grp *parent = blkg_to_tg(tg_to_blkg(tg)->parent);
+
+ tg_flush_bios(tg);
+
+ /* the recursive files of the ancestors go on counting what it did */
+ if (parent) {
+ blkg_rwstat_add_aux(&parent->stat_bytes, &tg->stat_bytes);
+ blkg_rwstat_add_aux(&parent->stat_ios, &tg->stat_ios);
+ blkg_rwstat_reset(&tg->stat_bytes);
+ blkg_rwstat_reset(&tg->stat_ios);
+ }
}
struct blkcg_policy blkcg_policy_throtl = {