Skip to content

Commit

Permalink
block, bfq: push up injection only after setting service time
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Paolo Valente <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Algodev-github authored and axboe committed Sep 18, 2019
1 parent 17c3d26 commit 58494c9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions block/bfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -5823,12 +5823,14 @@ static void bfq_update_inject_limit(struct bfq_data *bfqd,
*/
if ((bfqq->last_serv_time_ns == 0 && bfqd->rq_in_driver == 1) ||
tot_time_ns < bfqq->last_serv_time_ns) {
if (bfqq->last_serv_time_ns == 0) {
/*
* Now we certainly have a base value: make sure we
* start trying injection.
*/
bfqq->inject_limit = max_t(unsigned int, 1, old_limit);
}
bfqq->last_serv_time_ns = tot_time_ns;
/*
* Now we certainly have a base value: make sure we
* start trying injection.
*/
bfqq->inject_limit = max_t(unsigned int, 1, old_limit);
} else if (!bfqd->rqs_injected && bfqd->rq_in_driver == 1)
/*
* No I/O injected and no request still in service in
Expand Down

0 comments on commit 58494c9

Please sign in to comment.