summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 = {