Skip to content

Commit

Permalink
block: Reserve only one queue tag for sync IO if only 3 tags are avai…
Browse files Browse the repository at this point in the history
…lable

In case a device has three tags available we still reserve two of them
for sync IO. That leaves only a single tag for async IO such as
writeback from flusher thread which results in poor performance.

Allow async IO to consume two tags in case queue has three tag availabe
to get a decent async write performance.

This patch improves streaming write performance on a machine with such disk
from ~21 MB/s to ~52 MB/s. Also postmark throughput in presence of
streaming writer improves from 8 to 12 transactions per second so sync
IO doesn't seem to be harmed in presence of heavy async writer.

Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Signed-off-by: Pranav Vashi <[email protected]>
Signed-off-by: franciscofranco <[email protected]>
  • Loading branch information
jankara authored and Ma3aXaTa committed Nov 13, 2018
1 parent 42e1316 commit 1e2e9a7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions block/blk-tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,16 @@ int blk_queue_start_tag(struct request_queue *q, struct request *rq)
*/
max_depth = bqt->max_depth;
if (!rq_is_sync(rq) && max_depth > 1) {
max_depth -= 2;
if (!max_depth)
switch (max_depth) {
case 2:
max_depth = 1;
break;
case 3:
max_depth = 2;
break;
default:
max_depth -= 2;
}
if (q->in_flight[BLK_RW_ASYNC] > max_depth)
return 1;
}
Expand Down

0 comments on commit 1e2e9a7

Please sign in to comment.