aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-mq.c
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2015-10-20 11:13:54 -0400
committerJens Axboe <axboe@fb.com>2015-10-21 17:00:53 -0400
commite18378a60e27ad7b3e11ecc4e2c92159585dee68 (patch)
treedf6e568008eb82c3cc7f1ca6628d1aed56c73b3d /block/blk-mq.c
parent6ac45aeb6bcad38a2783a7d6e5da4c469497eeb0 (diff)
blk-mq: check bio_mergeable() early before merging
It isn't necessary to try to merge the bio which is marked as NOMERGE. Reviewed-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r--block/blk-mq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 9683a561efcd..d38371160019 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1140,7 +1140,7 @@ static inline bool blk_mq_merge_queue_io(struct blk_mq_hw_ctx *hctx,
1140 struct blk_mq_ctx *ctx, 1140 struct blk_mq_ctx *ctx,
1141 struct request *rq, struct bio *bio) 1141 struct request *rq, struct bio *bio)
1142{ 1142{
1143 if (!hctx_allow_merges(hctx)) { 1143 if (!hctx_allow_merges(hctx) || !bio_mergeable(bio)) {
1144 blk_mq_bio_to_request(rq, bio); 1144 blk_mq_bio_to_request(rq, bio);
1145 spin_lock(&ctx->lock); 1145 spin_lock(&ctx->lock);
1146insert_rq: 1146insert_rq: