summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2015-10-20 17:13:54 +0200
committerJens Axboe <axboe@fb.com>2015-10-21 23:00:53 +0200
commite18378a60e27ad7b3e11ecc4e2c92159585dee68 (patch)
treedf6e568008eb82c3cc7f1ca6628d1aed56c73b3d /block
parentblock: avoid to merge splitted bio (diff)
downloadlinux-e18378a60e27ad7b3e11ecc4e2c92159585dee68.tar.xz
linux-e18378a60e27ad7b3e11ecc4e2c92159585dee68.zip
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')
-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,
struct blk_mq_ctx *ctx,
struct request *rq, struct bio *bio)
{
- if (!hctx_allow_merges(hctx)) {
+ if (!hctx_allow_merges(hctx) || !bio_mergeable(bio)) {
blk_mq_bio_to_request(rq, bio);
spin_lock(&ctx->lock);
insert_rq: