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,