summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorPaolo Valente <paolo.valente@linaro.org>2019-08-22 11:20:37 -0400
committerJens Axboe <axboe@kernel.dk>2019-09-17 22:03:49 -0400
commit58494c980f40274c465ebfdece02d401def088bf (patch)
tree16500553ac438b09d4524e54ef069bfadbb03b27 /block
parent17c3d2660268501d36b75c7c7083dc8f2bbb93c3 (diff)
block, bfq: push up injection only after setting service time
If equal to 0, the injection limit for a bfq_queue is pushed to 1 after a first sample of the total service time of the I/O requests of the queue is computed (to allow injection to start). Yet, because of a mistake in the branch that performs this action, the push may happen also in some other case. This commit fixes this issue. Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name> Signed-off-by: Paolo Valente <paolo.valente@linaro.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/bfq-iosched.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index ddac93e910fa..0319d6339822 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -5823,12 +5823,14 @@ static void bfq_update_inject_limit(struct bfq_data *bfqd,
5823 */ 5823 */
5824 if ((bfqq->last_serv_time_ns == 0 && bfqd->rq_in_driver == 1) || 5824 if ((bfqq->last_serv_time_ns == 0 && bfqd->rq_in_driver == 1) ||
5825 tot_time_ns < bfqq->last_serv_time_ns) { 5825 tot_time_ns < bfqq->last_serv_time_ns) {
5826 if (bfqq->last_serv_time_ns == 0) {
5827 /*
5828 * Now we certainly have a base value: make sure we
5829 * start trying injection.
5830 */
5831 bfqq->inject_limit = max_t(unsigned int, 1, old_limit);
5832 }
5826 bfqq->last_serv_time_ns = tot_time_ns; 5833 bfqq->last_serv_time_ns = tot_time_ns;
5827 /*
5828 * Now we certainly have a base value: make sure we
5829 * start trying injection.
5830 */
5831 bfqq->inject_limit = max_t(unsigned int, 1, old_limit);
5832 } else if (!bfqd->rqs_injected && bfqd->rq_in_driver == 1) 5834 } else if (!bfqd->rqs_injected && bfqd->rq_in_driver == 1)
5833 /* 5835 /*
5834 * No I/O injected and no request still in service in 5836 * No I/O injected and no request still in service in