Re: [PATCH 06/16] block: clean up blk_mq_submit_bio() merging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/20/21 07:16, Christoph Hellwig wrote:
On Tue, Oct 19, 2021 at 10:24:15PM +0100, Pavel Begunkov wrote:
Combine blk_mq_sched_bio_merge() and blk_attempt_plug_merge() under a
common if, so we don't check it twice. Also honor bio_mergeable() for
blk_mq_sched_bio_merge().

Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx>
---
  block/blk-mq-sched.c |  2 +-
  block/blk-mq-sched.h | 12 +-----------
  block/blk-mq.c       | 13 +++++++------
  3 files changed, 9 insertions(+), 18 deletions(-)

[...]
diff --git a/block/blk-mq.c b/block/blk-mq.c
index bab1fccda6ca..218bfaa98591 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2482,12 +2482,13 @@ void blk_mq_submit_bio(struct bio *bio)
  	if (!bio_integrity_prep(bio))
  		goto queue_exit;
- if (!is_flush_fua && !blk_queue_nomerges(q) &&
-	    blk_attempt_plug_merge(q, bio, nr_segs, &same_queue_rq))
-		goto queue_exit;
-
-	if (blk_mq_sched_bio_merge(q, bio, nr_segs))
-		goto queue_exit;
+	if (!blk_queue_nomerges(q) && bio_mergeable(bio)) {

bio_mergeable just checks REQ_NOMERGE_FLAGS, which includes
REQ_PREFLUSH and REQ_FUA...

+		if (!is_flush_fua &&

... so this is not needed.

Missed it, thanks. I also need to update the message then

--
Pavel Begunkov



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux