Commit 1b2e19f1 authored by Shaohua Li's avatar Shaohua Li Committed by Jens Axboe

block: make auto block plug flush threshold per-disk based

We do auto block plug flush to reduce latency, the threshold is 16
requests. This works well if the task is accessing one or two drives.
The problem is if the task is accessing a raid 0 device and the raid
disk number is big, say 8 or 16, 16/8 = 2 or 16/16=1, we will have
heavy lock contention.

This patch makes the threshold per-disk based. The latency should be
still ok accessing one or two drives. The setup with application
accessing a lot of drives in the meantime uaually is big machine,
avoiding lock contention is more important, because any contention
will actually increase latency.
Signed-off-by: default avatarShaohua Li <shli@fusionio.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 407ac95e
...@@ -1277,6 +1277,7 @@ static bool attempt_plug_merge(struct request_queue *q, struct bio *bio, ...@@ -1277,6 +1277,7 @@ static bool attempt_plug_merge(struct request_queue *q, struct bio *bio,
list_for_each_entry_reverse(rq, &plug->list, queuelist) { list_for_each_entry_reverse(rq, &plug->list, queuelist) {
int el_ret; int el_ret;
if (rq->q == q)
(*request_count)++; (*request_count)++;
if (rq->q != q || !blk_rq_merge_ok(rq, bio)) if (rq->q != q || !blk_rq_merge_ok(rq, bio))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment