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 19:33:03 +0800 [thread overview]
Message-ID: <Z63Yb9_wvjqLbg47@fedora> (raw)
In-Reply-To: <80fb598a-ed65-4e6f-9781-7742086a1d19@oracle.com>
On Thu, Feb 13, 2025 at 11:12:07AM +0000, John Garry wrote:
> On 13/02/2025 10:35, Ming Lei wrote:
> > > > 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?
> > Yes, hardware limit needs to be respected.
> >
> > Looks one write atomic application trouble in case of 64K page size,
> > and it can't work w/wo this patchset.
>
> I think that we need to take max_segment_size into account in
> blk_queue_max_guaranteed_bio(), like:
>
> static unsigned int blk_queue_max_guaranteed_bio(struct queue_limits *lim)
> {
> unsigned int max_segments = min(BIO_MAX_VECS, lim->max_segments);
> unsigned int length;
>
> length = min(max_segments, 2) * lim->logical_block_size;
> if (max_segments > 2)
> length += (max_segments - 2) * min(PAGE_SIZE, lim->max_segment_size);
>
> return length;
> }
>
> Note that blk_queue_max_guaranteed_bio() is only really relevant to dio, so
> assumes that the iov_iter follows the bdev dio rules
It can't work because ITER_UBUF from pwritev2(iovcnt=1) is virtually-contiguous,
and the middle segment size has to be PAGE_SIZE.
Thanks,
Ming
next prev parent reply other threads:[~2025-02-13 11:33 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
2025-02-13 10:35 ` Ming Lei
2025-02-13 11:12 ` John Garry
2025-02-13 11:33 ` Ming Lei [this message]
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=Z63Yb9_wvjqLbg47@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 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.