public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: John Garry <john.g.garry@oracle.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 17:58:59 +0800	[thread overview]
Message-ID: <Z63CY9rE7X8m3nmv@fedora> (raw)
In-Reply-To: <faf95365-5b55-40f6-82f8-195ccc3edb9e@oracle.com>

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.


Thanks,
Ming


  reply	other threads:[~2025-02-13  9:59 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 [this message]
2025-02-13 10:23     ` John Garry
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=Z63CY9rE7X8m3nmv@fedora \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=john.g.garry@oracle.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --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