From: Gabriel Krisman Bertazi <krisman@suse.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: io-uring@vger.kernel.org, Martin Michaelis <code@mgjm.de>,
stable@vger.kernel.org
Subject: Re: [PATCH 2/2] io_uring/kbuf: support min length left for incremental buffers
Date: Tue, 28 Apr 2026 15:08:01 -0400 [thread overview]
Message-ID: <877bpqkini.fsf@mailhost.krisman.be> (raw)
In-Reply-To: <7645db80-8a8a-4ed6-9a3a-f2406cf93322@kernel.dk> (Jens Axboe's message of "Tue, 28 Apr 2026 12:02:34 -0600")
Jens Axboe <axboe@kernel.dk> writes:
>> Honest question, isn't this a property of the specific operation and/or
>> fd being operated, instead of the buffer_reg?
>
> It kind of is, in that some users may not care. But it's not currently
> possible to pass this in on a per-op basis, and while I did hack that
> up initially, it's almost impossible as you end up with layering
> violations. In practice, this is really mostly a recvmsg multishot
> issue, because we need to store the headers. Hence the solution to
> stuff it in the io_uring_buf_reg instead, and make it a fixed property
> of the buffer group. In practice, you may even want a larger min_left
> than what the recvmsg requires, as you don't want a tiny truncated
> transfer at the end, regardless of what type of recv or read operation
> this is. Hence it works generically as well.
>
> Also see the linked GH issue, that's where most of the discussion
> around this have happened already.
>
>>> - if (buf_len || !this_len) {
>>> + if (buf_len > bl->min_left_sub_one || !this_len) {
>>
>> Cosmetic, but perhaps store min_left_sub_one instead of min_left itself? the
>> buf_len must be >= min_left, and that is easier to read. (buf_len &&
>> buf_len >= min_left || !this_len)
>
> Also see GH issue.
Ack. Thanks. Feel free to add:
Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
--
Gabriel Krisman Bertazi
prev parent reply other threads:[~2026-04-28 19:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-28 15:44 [PATCHSET 0/2] kbuf fixes Jens Axboe
2026-04-28 15:44 ` [PATCH 1/2] io_uring/kbuf: kill dead struct io_buffer_list 'nr_entries' member Jens Axboe
2026-04-28 17:54 ` Gabriel Krisman Bertazi
2026-04-28 15:44 ` [PATCH 2/2] io_uring/kbuf: support min length left for incremental buffers Jens Axboe
2026-04-28 17:53 ` Gabriel Krisman Bertazi
2026-04-28 18:02 ` Jens Axboe
2026-04-28 19:08 ` Gabriel Krisman Bertazi [this message]
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=877bpqkini.fsf@mailhost.krisman.be \
--to=krisman@suse.de \
--cc=axboe@kernel.dk \
--cc=code@mgjm.de \
--cc=io-uring@vger.kernel.org \
--cc=stable@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