From: Christoph Hellwig <hch@lst.de>
To: Keith Busch <kbusch@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org
Subject: Re: [PATCH 2/2] block: support adding less than len in bio_add_hw_page
Date: Tue, 5 Dec 2023 19:52:34 +0100 [thread overview]
Message-ID: <20231205185234.GB21354@lst.de> (raw)
In-Reply-To: <ZW9R29OUl3j8BH43@kbusch-mbp>
On Tue, Dec 05, 2023 at 09:37:47AM -0700, Keith Busch wrote:
> > - if (((bio->bi_iter.bi_size + len) >> SECTOR_SHIFT) > max_sectors)
> > + len = min3(len, max_size, queue_max_segment_size(q));
> > + if (len > max_size - bio->bi_iter.bi_size)
> > return 0;
> >
> > if (bio->bi_vcnt > 0) {
>
> Not related to your patch, but noticed while reviewing: would it not be
> beneficial to truncate 'len' down to what can fit in the current-segment
> instead of assuming the max segment size?
That would be pretty intrusive to the code shared with the normal not
hw limited bio add code, so I decided to keep it simple.
next prev parent reply other threads:[~2023-12-05 18:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 17:34 fix bio_add_hw_page for larger folios / compound pages Christoph Hellwig
2023-12-04 17:34 ` [PATCH 1/2] block: prevent an integer overflow in bvec_try_merge_hw_page Christoph Hellwig
2023-12-04 17:34 ` [PATCH 2/2] block: support adding less than len in bio_add_hw_page Christoph Hellwig
2023-12-05 16:34 ` Johannes Thumshirn
2023-12-05 18:52 ` Christoph Hellwig
2023-12-05 16:37 ` Keith Busch
2023-12-05 18:52 ` Christoph Hellwig [this message]
2023-12-05 16:35 ` fix bio_add_hw_page for larger folios / compound pages Johannes Thumshirn
2023-12-11 17:01 ` Christoph Hellwig
2023-12-15 14:35 ` 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=20231205185234.GB21354@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=kbusch@kernel.org \
--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