diff options
author | Paolo Valente <paolo.valente@linaro.org> | 2017-04-12 12:23:19 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-04-19 10:30:26 -0400 |
commit | e01eff01d5c81f4dbba186299b16b08aa7316d5b (patch) | |
tree | 9a6cd957d0ca463247d3e57438cfec5e2702a661 /block/bfq-iosched.c | |
parent | bf2b79e7c4b312aa6e1c661fb27e0dc4dd42f2c2 (diff) |
block, bfq: boost the throughput with random I/O on NCQ-capable HDDs
This patch is basically the counterpart, for NCQ-capable rotational
devices, of the previous patch. Exactly as the previous patch does on
flash-based devices and for any workload, this patch disables device
idling on rotational devices, but only for random I/O. In fact, only
with these queues disabling idling boosts the throughput on
NCQ-capable rotational devices. To not break service guarantees,
idling is disabled for NCQ-enabled rotational devices only when the
same symmetry conditions considered in the previous patches hold.
Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/bfq-iosched.c')
-rw-r--r-- | block/bfq-iosched.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 208178478dc4..549f030509ef 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c | |||
@@ -6439,20 +6439,15 @@ static bool bfq_bfqq_may_idle(struct bfq_queue *bfqq) | |||
6439 | * The next variable takes into account the cases where idling | 6439 | * The next variable takes into account the cases where idling |
6440 | * boosts the throughput. | 6440 | * boosts the throughput. |
6441 | * | 6441 | * |
6442 | * The value of the variable is computed considering that | 6442 | * The value of the variable is computed considering, first, that |
6443 | * idling is usually beneficial for the throughput if: | 6443 | * idling is virtually always beneficial for the throughput if: |
6444 | * (a) the device is not NCQ-capable, or | 6444 | * (a) the device is not NCQ-capable, or |
6445 | * (b) regardless of the presence of NCQ, the device is rotational | 6445 | * (b) regardless of the presence of NCQ, the device is rotational |
6446 | * and the request pattern for bfqq is I/O-bound (possible | 6446 | * and the request pattern for bfqq is I/O-bound and sequential. |
6447 | * throughput losses caused by granting idling to seeky queues | ||
6448 | * are mitigated by the fact that, in all scenarios where | ||
6449 | * boosting throughput is the best thing to do, i.e., in all | ||
6450 | * symmetric scenarios, only a minimal idle time is allowed to | ||
6451 | * seeky queues). | ||
6452 | * | 6447 | * |
6453 | * Secondly, and in contrast to the above item (b), idling an | 6448 | * Secondly, and in contrast to the above item (b), idling an |
6454 | * NCQ-capable flash-based device would not boost the | 6449 | * NCQ-capable flash-based device would not boost the |
6455 | * throughput even with intense I/O; rather it would lower | 6450 | * throughput even with sequential I/O; rather it would lower |
6456 | * the throughput in proportion to how fast the device | 6451 | * the throughput in proportion to how fast the device |
6457 | * is. Accordingly, the next variable is true if any of the | 6452 | * is. Accordingly, the next variable is true if any of the |
6458 | * above conditions (a) and (b) is true, and, in particular, | 6453 | * above conditions (a) and (b) is true, and, in particular, |
@@ -6460,7 +6455,8 @@ static bool bfq_bfqq_may_idle(struct bfq_queue *bfqq) | |||
6460 | * device. | 6455 | * device. |
6461 | */ | 6456 | */ |
6462 | idling_boosts_thr = !bfqd->hw_tag || | 6457 | idling_boosts_thr = !bfqd->hw_tag || |
6463 | (!blk_queue_nonrot(bfqd->queue) && bfq_bfqq_IO_bound(bfqq)); | 6458 | (!blk_queue_nonrot(bfqd->queue) && bfq_bfqq_IO_bound(bfqq) && |
6459 | bfq_bfqq_idle_window(bfqq)); | ||
6464 | 6460 | ||
6465 | /* | 6461 | /* |
6466 | * The value of the next variable, | 6462 | * The value of the next variable, |