diff options
author | Paolo Valente <paolo.valente@linaro.org> | 2019-06-25 01:12:45 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-06-25 11:07:34 -0400 |
commit | 24792ad01cb659c8b5899de2af6e8ca250f93df3 (patch) | |
tree | ccb4a16c5352a4334c88e2ec647e49c66947857f /block/bfq-iosched.c | |
parent | db599f9ed9bd31b018b6c48ad7c6b21d5b790ecf (diff) |
block, bfq: update base request service times when possible
I/O injection gets reduced if it increases the request service times
of the victim queue beyond a certain threshold. The threshold, in its
turn, is computed as a function of the base service time enjoyed by
the queue when it undergoes no injection.
As a consequence, for injection to work properly, the above base value
has to be accurate. In this respect, such a value may vary over
time. For example, it varies if the size or the spatial locality of
the I/O requests in the queue change. It is then important to update
this value whenever possible. This commit performs this update.
Reported-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu>
Tested-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu>
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.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 05041f84b8da..62442083b147 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c | |||
@@ -5496,7 +5496,18 @@ static void bfq_update_inject_limit(struct bfq_data *bfqd, | |||
5496 | * start trying injection. | 5496 | * start trying injection. |
5497 | */ | 5497 | */ |
5498 | bfqq->inject_limit = max_t(unsigned int, 1, old_limit); | 5498 | bfqq->inject_limit = max_t(unsigned int, 1, old_limit); |
5499 | } | 5499 | } else if (!bfqd->rqs_injected && bfqd->rq_in_driver == 1) |
5500 | /* | ||
5501 | * No I/O injected and no request still in service in | ||
5502 | * the drive: these are the exact conditions for | ||
5503 | * computing the base value of the total service time | ||
5504 | * for bfqq. So let's update this value, because it is | ||
5505 | * rather variable. For example, it varies if the size | ||
5506 | * or the spatial locality of the I/O requests in bfqq | ||
5507 | * change. | ||
5508 | */ | ||
5509 | bfqq->last_serv_time_ns = tot_time_ns; | ||
5510 | |||
5500 | 5511 | ||
5501 | /* update complete, not waiting for any request completion any longer */ | 5512 | /* update complete, not waiting for any request completion any longer */ |
5502 | bfqd->waited_rq = NULL; | 5513 | bfqd->waited_rq = NULL; |