From 587edb931fdda032bcd63fdfb0db4ded75159ee9 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 28 Oct 2026 10:41:28 -0600 Subject: 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 Signed-off-by: Josef Bacik Acked-by: Tejun Heo Link: https://patch.msgid.link/20261028164415.1262013-26-axboe@kernel.dk Signed-off-by: Jens Axboe --- block/blk-throttle.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 = { -- cgit v1.2.3