From: John Garry <john.g.garry@oracle.com>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, Yi Zhang <yi.zhang@redhat.com>,
Luis Chamberlain <mcgrof@kernel.org>,
Bart Van Assche <bvanassche@acm.org>,
Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH V2] block: make segment size limit workable for > 4K PAGE_SIZE
Date: Thu, 13 Feb 2025 10:23:02 +0000 [thread overview]
Message-ID: <63bdc82a-fa01-44ae-9142-2cb649d34fb7@oracle.com> (raw)
In-Reply-To: <Z63CY9rE7X8m3nmv@fedora>
On 13/02/2025 09:58, Ming Lei wrote:
> On Thu, Feb 13, 2025 at 08:45:18AM +0000, John Garry wrote:
>> On 10/02/2025 09:03, Ming Lei wrote:
>>> PAGE_SIZE is applied in some block device queue limits, this way is
>>> very fragile and is wrong:
>>>
>>> - queue limits are read from hardware, which is often one readonly
>>> hardware property
>>>
>>> - PAGE_SIZE is one config option which can be changed during build time.
>>>
>>> In RH lab, it has been found that max segment size of some mmc card is
>>> less than 64K, then this kind of card can't work in case of 64K PAGE_SIZE.
>>>
>>> Fix this issue by using BLK_MIN_SEGMENT_SIZE in related code for dealing
>>> with queue limits and checking if bio needn't split. Define BLK_MIN_SEGMENT_SIZE
>>> as 4K(minimized PAGE_SIZE).
>> Please note that blk_queue_max_quaranteed_bio() for atomic writes assumes
>> that we can fit a PAGE_SIZE in a segment. I suppose that if the
>> max_segment_size < PAGE_SIZE is supported, then the calculation there needs
>> to change.
> It isn't related with blk_queue_max_guaranteed_bio() which calculates the max
> allowed ubuf bytes which can fit in a bio, so PAGE_SIZE has to be used here.
>
> BLK_MIN_SEGMENT_SIZE is just one hint which can be used to check if one
> bvec can fit in single segment quickly, otherwise the normal split code
> path is run into.
So consider we have PAGE_SIZE > 4k and max_segment_size=4k, if an iovec
has PAGE_SIZE then a bvec can also have PAGE_SIZE but then we need to
split into multiple segments, right?
Thanks,
John
next prev parent reply other threads:[~2025-02-13 10:23 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-10 9:03 [PATCH V2] block: make segment size limit workable for > 4K PAGE_SIZE Ming Lei
2025-02-10 12:14 ` Hannes Reinecke
2025-02-10 13:26 ` Ming Lei
2025-02-10 20:17 ` Luis Chamberlain
2025-02-11 2:10 ` Ming Lei
2025-02-13 7:34 ` Daniel Gomez
2025-02-13 8:02 ` Ming Lei
2025-02-13 8:30 ` Christoph Hellwig
2025-02-13 8:51 ` Ming Lei
2025-02-13 14:18 ` Daniel Gomez
2025-02-14 1:37 ` Ming Lei
2025-02-13 8:33 ` Christoph Hellwig
2025-02-13 8:45 ` John Garry
2025-02-13 9:58 ` Ming Lei
2025-02-13 10:23 ` John Garry [this message]
2025-02-13 10:35 ` Ming Lei
2025-02-13 11:12 ` John Garry
2025-02-13 11:33 ` Ming Lei
2025-02-13 11:41 ` John Garry
2025-02-14 9:38 ` Daniel Gomez
2025-02-14 11:19 ` Ming Lei
2025-02-14 12:28 ` Daniel Gomez
2025-02-14 12:51 ` Ming Lei
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=63bdc82a-fa01-44ae-9142-2cb649d34fb7@oracle.com \
--to=john.g.garry@oracle.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=ming.lei@redhat.com \
--cc=yi.zhang@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox