From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753086AbbJQPw4 (ORCPT ); Sat, 17 Oct 2015 11:52:56 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:35247 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752997AbbJQPww (ORCPT ); Sat, 17 Oct 2015 11:52:52 -0400 From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: Ming Lin , Kent Overstreet , Christoph Hellwig , Jeff Moyer , Ming Lei Subject: [PATCH v1 3/6] blk-mq: check bio_mergeable() early before merging Date: Sat, 17 Oct 2015 23:52:31 +0800 Message-Id: <1445097154-18229-4-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445097154-18229-1-git-send-email-ming.lei@canonical.com> References: <1445097154-18229-1-git-send-email-ming.lei@canonical.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It isn't necessary to try to merge the bio which is marked as NOMERGE. Signed-off-by: Ming Lei --- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 546b3b8..d55d022 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: -- 1.9.1