summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorShaohua Li <shli@fusionio.com>2012-04-06 11:37:47 -0600
committerVarun Wadekar <vwadekar@nvidia.com>2012-04-18 20:30:40 +0530
commit545898c0c94eb23247a27fc276381ffbde6e9fce (patch)
tree275176117e0a220b9fc3ec1641f3b52c536c0ba0 /block
parentc04d4ca3b3600429958ae79a07bec9cd44f34e45 (diff)
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: Shaohua Li <shli@fusionio.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 414e8224588f..1f61b74867e4 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1277,7 +1277,8 @@ static bool attempt_plug_merge(struct request_queue *q, struct bio *bio,
list_for_each_entry_reverse(rq, &plug->list, queuelist) {
int el_ret;
- (*request_count)++;
+ if (rq->q == q)
+ (*request_count)++;
if (rq->q != q || !blk_rq_merge_ok(rq, bio))
continue;