aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Valente <paolo.valente@linaro.org>2018-08-16 12:51:16 -0400
committerJens Axboe <axboe@kernel.dk>2018-08-16 15:08:12 -0400
commite02a0aa26bf61b6e481a3d7453a150e692b0df80 (patch)
tree5e175d59711d0dea226ccc6dc33578545f211f44
parent8a511ba5feec5947bee0635cff8bd796d5f77e3e (diff)
block, bfq: always update the budget of an entity when needed
When the next child entity to serve changes for a given parent entity, the budget of that parent entity must be updated accordingly. Unfortunately, this update is not performed, by mistake, for the entities that happen to switch from having no child entity to serve, to having one child entity to serve. Signed-off-by: Paolo Valente <paolo.valente@linaro.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/bfq-wf2q.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
index dbc07b456059..d558fd26740c 100644
--- a/block/bfq-wf2q.c
+++ b/block/bfq-wf2q.c
@@ -130,10 +130,14 @@ static bool bfq_update_next_in_service(struct bfq_sched_data *sd,
130 if (!change_without_lookup) /* lookup needed */ 130 if (!change_without_lookup) /* lookup needed */
131 next_in_service = bfq_lookup_next_entity(sd, expiration); 131 next_in_service = bfq_lookup_next_entity(sd, expiration);
132 132
133 if (next_in_service) 133 if (next_in_service) {
134 parent_sched_may_change = !sd->next_in_service || 134 bool new_budget_triggers_change =
135 bfq_update_parent_budget(next_in_service); 135 bfq_update_parent_budget(next_in_service);
136 136
137 parent_sched_may_change = !sd->next_in_service ||
138 new_budget_triggers_change;
139 }
140
137 sd->next_in_service = next_in_service; 141 sd->next_in_service = next_in_service;
138 142
139 if (!next_in_service) 143 if (!next_in_service)