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 1/3] blk-mq: only try to run plug merge if request has same queue with incoming bio
Date: Tue, 2 Nov 2021 21:35:00 +0800 [thread overview]
Message-ID: <20211102133502.3619184-2-ming.lei@redhat.com> (raw)
In-Reply-To: <20211102133502.3619184-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
next prev parent reply other threads:[~2021-11-02 13:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-02 13:34 [PATCH 0/3] blk-mq: misc fixes Ming Lei
2021-11-02 13:35 ` Ming Lei [this message]
2021-11-02 13:35 ` [PATCH 2/3] blk-mq: add RQF_ELV debug entry Ming Lei
2021-11-02 13:35 ` [PATCH 3/3] blk-mq: update hctx->nr_active in blk_mq_end_request_batch() Ming Lei
2021-11-02 13:47 ` Jens Axboe
2021-11-02 13:57 ` Ming Lei
2021-11-02 14:57 ` Jens Axboe
2021-11-02 15:08 ` Ming Lei
2021-11-02 15:20 ` Jens Axboe
2021-11-02 15:23 ` 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=20211102133502.3619184-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).