summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2015-10-20 23:13:54 +0800
committerJens Axboe <axboe@fb.com>2015-10-21 15:00:53 -0600
commite18378a60e27ad7b3e11ecc4e2c92159585dee68 (patch)
treedf6e568008eb82c3cc7f1ca6628d1aed56c73b3d /block
parent6ac45aeb6bcad38a2783a7d6e5da4c469497eeb0 (diff)
downloadop-kernel-dev-e18378a60e27ad7b3e11ecc4e2c92159585dee68.zip
op-kernel-dev-e18378a60e27ad7b3e11ecc4e2c92159585dee68.tar.gz
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 9683a56..d383711 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:
OpenPOWER on IntegriCloud