diff options
author | Ming Lei <ming.lei@canonical.com> | 2015-10-20 23:13:54 +0800 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-10-21 15:00:53 -0600 |
commit | e18378a60e27ad7b3e11ecc4e2c92159585dee68 (patch) | |
tree | df6e568008eb82c3cc7f1ca6628d1aed56c73b3d /block | |
parent | 6ac45aeb6bcad38a2783a7d6e5da4c469497eeb0 (diff) | |
download | linux-e18378a60e27ad7b3e11ecc4e2c92159585dee68.tar.gz linux-e18378a60e27ad7b3e11ecc4e2c92159585dee68.tar.bz2 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.c | 2 |
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: |