From: Keith Busch <kbusch@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Yu Kuai <yukuai@fnnas.com>, Matthew Wilcox <willy@infradead.org>,
Keith Busch <kbusch@meta.com>,
linux-nvme@lists.infradead.org, linux-block@vger.kernel.org,
axboe@kernel.dk
Subject: Re: [PATCHv5 1/2] block: accumulate memory segment gaps per bio
Date: Tue, 11 Nov 2025 08:54:53 -0500 [thread overview]
Message-ID: <aRNALUnnxzIuyHng@kbusch-mbp> (raw)
In-Reply-To: <20251111134001.GA708@lst.de>
On Tue, Nov 11, 2025 at 02:40:01PM +0100, Christoph Hellwig wrote:
> On Tue, Nov 11, 2025 at 08:25:38AM -0500, Keith Busch wrote:
> > Ah, so we're merging a discard for a device that doesn't support
> > vectored discard. I think we still want to be able to front/back merge
> > such requests, though.
>
> Yes, but purely based on bi_sector/bi_size, not based on the payload.
This should do it:
---
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 3ca6fbf8b7870..d3115d7469df0 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -737,6 +737,9 @@ u8 bio_seg_gap(struct request_queue *q, struct bio *prev, struct bio *next,
{
struct bio_vec pb, nb;
+ if (!bio_has_data(prev))
+ return 0;
+
gaps_bit = min_not_zero(gaps_bit, prev->bi_bvec_gap_bit);
gaps_bit = min_not_zero(gaps_bit, next->bi_bvec_gap_bit);
--
next prev parent reply other threads:[~2025-11-11 13:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-14 15:04 [PATCHv5 0/2] block, nvme: removing virtual boundary mask reliance Keith Busch
2025-10-14 15:04 ` [PATCHv5 1/2] block: accumulate memory segment gaps per bio Keith Busch
2025-10-14 21:18 ` Martin K. Petersen
2025-10-15 4:08 ` Christoph Hellwig
2025-11-11 4:26 ` Matthew Wilcox
2025-11-11 4:50 ` Keith Busch
2025-11-11 7:14 ` Christoph Hellwig
2025-11-11 9:36 ` Yu Kuai
2025-11-11 9:39 ` Christoph Hellwig
2025-11-11 10:14 ` Yu Kuai
2025-11-11 13:25 ` Keith Busch
2025-11-11 13:40 ` Christoph Hellwig
2025-11-11 13:54 ` Keith Busch [this message]
2025-11-11 13:58 ` Christoph Hellwig
2025-11-11 14:03 ` Yu Kuai
2025-10-14 15:04 ` [PATCHv5 2/2] nvme: remove virtual boundary for sgl capable devices Keith Busch
2025-10-14 21:19 ` Martin K. Petersen
2025-11-07 1:03 ` [PATCHv5 0/2] block, nvme: removing virtual boundary mask reliance Keith Busch
2025-11-07 1:12 ` Jens Axboe
2025-11-07 1:12 ` 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=aRNALUnnxzIuyHng@kbusch-mbp \
--to=kbusch@kernel.org \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=kbusch@meta.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=willy@infradead.org \
--cc=yukuai@fnnas.com \
/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.