summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--block/bfq-iosched.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 41d9036b1822..62efc1b97afb 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -3298,6 +3298,27 @@ void bfq_bfqq_expire(struct bfq_data *bfqd,
3298 */ 3298 */
3299 } else 3299 } else
3300 entity->service = 0; 3300 entity->service = 0;
3301
3302 /*
3303 * Reset the received-service counter for every parent entity.
3304 * Differently from what happens with bfqq->entity.service,
3305 * the resetting of this counter never needs to be postponed
3306 * for parent entities. In fact, in case bfqq may have a
3307 * chance to go on being served using the last, partially
3308 * consumed budget, bfqq->entity.service needs to be kept,
3309 * because if bfqq then actually goes on being served using
3310 * the same budget, the last value of bfqq->entity.service is
3311 * needed to properly decrement bfqq->entity.budget by the
3312 * portion already consumed. In contrast, it is not necessary
3313 * to keep entity->service for parent entities too, because
3314 * the bubble up of the new value of bfqq->entity.budget will
3315 * make sure that the budgets of parent entities are correct,
3316 * even in case bfqq and thus parent entities go on receiving
3317 * service with the same budget.
3318 */
3319 entity = entity->parent;
3320 for_each_entity(entity)
3321 entity->service = 0;
3301} 3322}
3302 3323
3303/* 3324/*