All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Ming Lei <ming.lei@redhat.com>
Subject: [PATCH V2 1/3] blk-mq: only try to run plug merge if request has same queue with incoming bio
Date: Tue,  2 Nov 2021 23:36:17 +0800	[thread overview]
Message-ID: <20211102153619.3627505-2-ming.lei@redhat.com> (raw)
In-Reply-To: <20211102153619.3627505-1-ming.lei@redhat.com>

It is obvious that io merge can't be done between two different queues, so
just try to run io merge in case of same queue.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 block/blk-merge.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/block/blk-merge.c b/block/blk-merge.c
index df69f4bb7717..893c1a60b701 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -1101,9 +1101,11 @@ bool blk_attempt_plug_merge(struct request_queue *q, struct bio *bio,
 		 * the same queue, there should be only one such rq in a queue
 		 */
 		*same_queue_rq = true;
+
+		if (blk_attempt_bio_merge(q, rq, bio, nr_segs, false) ==
+				BIO_MERGE_OK)
+			return true;
 	}
-	if (blk_attempt_bio_merge(q, rq, bio, nr_segs, false) == BIO_MERGE_OK)
-		return true;
 	return false;
 }
 
-- 
2.31.1


  reply	other threads:[~2021-11-02 15:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02 15:36 [PATCH V2 0/3] blk-mq: misc fixes Ming Lei
2021-11-02 15:36 ` Ming Lei [this message]
2021-11-02 15:36 ` [PATCH V2 2/3] blk-mq: add RQF_ELV debug entry Ming Lei
2021-11-02 15:36 ` [PATCH V2 3/3] blk-mq: update hctx->nr_active in blk_mq_end_request_batch() Ming Lei
2021-11-02 22:43   ` Shinichiro Kawasaki
2021-11-02 22:44     ` Jens Axboe
2021-11-02 16:00 ` [PATCH V2 0/3] blk-mq: misc fixes Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211102153619.3627505-2-ming.lei@redhat.com \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.