From ac81a07a0bd5e75e8edc0eb5be563be1b2d56554 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 28 Oct 2026 10:41:29 -0600 Subject: [PATCH] blk-throttle: make blkio.reset_stats reset I/O counts blkio.throttle.io_service_bytes and io_serviced were reset by blkcg_reset_stats() while the counters were part of the blkg. Now that they live in the throtl_grp, add a pd_reset_stats_fn for them. 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-27-axboe@kernel.dk Signed-off-by: Jens Axboe --- block/blk-throttle.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 80a5e4b2872f..c46807a0faab 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -1684,6 +1684,14 @@ static void throtl_pd_offline(struct blkg_policy_data *pd) } } +static void throtl_pd_reset_stats(struct blkg_policy_data *pd) +{ + struct throtl_grp *tg = pd_to_tg(pd); + + blkg_rwstat_reset(&tg->stat_bytes); + blkg_rwstat_reset(&tg->stat_ios); +} + struct blkcg_policy blkcg_policy_throtl = { .dfl_cftypes = throtl_files, .legacy_cftypes = throtl_legacy_files, @@ -1693,6 +1701,7 @@ struct blkcg_policy blkcg_policy_throtl = { .pd_online_fn = throtl_pd_online, .pd_offline_fn = throtl_pd_offline, .pd_free_fn = throtl_pd_free, + .pd_reset_stats_fn = throtl_pd_reset_stats, }; static void tg_cancel_writeback_bios(struct throtl_grp *tg,