summaryrefslogtreecommitdiffstats
path: root/block/bfq-iosched.c
diff options
context:
space:
mode:
authorFrancesco Pollicino <fra.fra.800@gmail.com>2019-03-12 04:59:34 -0400
committerJens Axboe <axboe@kernel.dk>2019-04-01 10:15:40 -0400
commitfffca087d587b03d0d0dca2e86bf8e688fbf2c18 (patch)
tree2ea5b0643ecf6adf4971033b21deaa9cbae63f03 /block/bfq-iosched.c
parent1e66413c4f68e2a61a210e4f5ff5df7a2ab86a5b (diff)
block, bfq: save & resume weight on a queue merge/split
bfq saves the state of a queue each time a merge occurs, to be able to resume such a state when the queue is associated again with its original process, on a split. Unfortunately bfq does not save & restore also the weight of the queue. If the weight is not correctly resumed when the queue is recycled, then the weight of the recycled queue could differ from the weight of the original queue. This commit adds the missing save & resume of the weight. Tested-by: Holger Hoffstätte <holger@applied-asynchrony.com> Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name> Signed-off-by: Francesco Pollicino <fra.fra.800@gmail.com> Signed-off-by: Paolo Valente <paolo.valente@linaro.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bfq-iosched.c')
-rw-r--r--block/bfq-iosched.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 37cc8f127cf6..ceb06abd73df 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -1028,6 +1028,7 @@ bfq_bfqq_resume_state(struct bfq_queue *bfqq, struct bfq_data *bfqd,
1028 else 1028 else
1029 bfq_clear_bfqq_IO_bound(bfqq); 1029 bfq_clear_bfqq_IO_bound(bfqq);
1030 1030
1031 bfqq->entity.new_weight = bic->saved_weight;
1031 bfqq->ttime = bic->saved_ttime; 1032 bfqq->ttime = bic->saved_ttime;
1032 bfqq->wr_coeff = bic->saved_wr_coeff; 1033 bfqq->wr_coeff = bic->saved_wr_coeff;
1033 bfqq->wr_start_at_switch_to_srt = bic->saved_wr_start_at_switch_to_srt; 1034 bfqq->wr_start_at_switch_to_srt = bic->saved_wr_start_at_switch_to_srt;
@@ -2502,6 +2503,7 @@ static void bfq_bfqq_save_state(struct bfq_queue *bfqq)
2502 if (!bic) 2503 if (!bic)
2503 return; 2504 return;
2504 2505
2506 bic->saved_weight = bfqq->entity.orig_weight;
2505 bic->saved_ttime = bfqq->ttime; 2507 bic->saved_ttime = bfqq->ttime;
2506 bic->saved_has_short_ttime = bfq_bfqq_has_short_ttime(bfqq); 2508 bic->saved_has_short_ttime = bfq_bfqq_has_short_ttime(bfqq);
2507 bic->saved_IO_bound = bfq_bfqq_IO_bound(bfqq); 2509 bic->saved_IO_bound = bfq_bfqq_IO_bound(bfqq);