summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2012-07-03 10:58:53 -0600
committerJens Axboe <axboe@kernel.dk>2012-10-04 11:04:35 +0200
commitd992fc6c6aef71a280fd1336229c4bba99018db7 (patch)
treecdd21d0ca43c91136c15e78209920908abb63a97
parentf13ddbd51c6d3a6e53d85b522f334611b002ecdf (diff)
multiqueue: stop merge checking if we hit a potential merge and failed
If blk_try_merge() returns that a merge would be possible and we failed merging, we have most likely hit segment (or other) restrictions. In that case, stop checking further, likelihood of a merge is then pretty much 0. Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/blk-mq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 0f0d7c73c636..4f53b4c0f902 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -200,11 +200,13 @@ static bool blk_mq_attempt_merge(struct request_queue *q,
ctx->rq_merged++;
return true;
}
+ break;
} else if (el_ret == ELEVATOR_FRONT_MERGE) {
if (bio_attempt_front_merge(q, rq, bio)) {
ctx->rq_merged++;
return true;
}
+ break;
}
}