From: Hao Xu <[email protected]>
To: Pavel Begunkov <[email protected]>,
Dylan Yudaken <[email protected]>,
"[email protected]" <[email protected]>,
"[email protected]" <[email protected]>
Cc: Kernel Team <[email protected]>
Subject: Re: [PATCH 0/3] io_uring: fixes for provided buffer ring
Date: Tue, 14 Jun 2022 11:47:04 +0800 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 6/13/22 22:05, Pavel Begunkov wrote:
> On 6/13/22 14:16, Dylan Yudaken wrote:
>> On Mon, 2022-06-13 at 13:59 +0100, Pavel Begunkov wrote:
>>> On 6/13/22 12:08, Hao Xu wrote:
>>>> On 6/13/22 18:11, Dylan Yudaken wrote:
>>>>> This fixes two problems in the new provided buffer ring feature.
>>>>> One
>>>>> is a simple arithmetic bug (I think this came out from a
>>>>> refactor).
>>>>> The other is due to type differences between head & tail, which
>>>>> causes
>>>>> it to sometimes reuse an old buffer incorrectly.
>>>>>
>>>>> Patch 1&2 fix bugs
>>>>> Patch 3 limits the size of the ring as it's not
>>>>> possible to address more entries with 16 bit head/tail
>>>>
>>>> Reviewed-by: Hao Xu <[email protected]>
>>>>
>>>>>
>>>>> I will send test cases for liburing shortly.
>>>>>
>>>>> One question might be if we should change the type of
>>>>> ring_entries
>>>>> to uint16_t in struct io_uring_buf_reg?
>>>>
>>>> Why not? 5.19 is just rc2 now. So we can assume there is no users
>>>> using
>>>> it right now I think?
>>>
>>> It's fine to change, but might be better if we want to extend it
>>> in the future. Do other pbuf bits allow more than 2^16 buffers?
>>>
>
> might be better to leave it u32 *
>
>> I guess with
>>
>> + if (reg.ring_entries >= 65536)
>> + return -EINVAL;
>>
>> it doesn't matter either way. we can always use those bits later if we
>> need?
>
> I think so as well.
>
> I was also wondering whether pbufs can potentially allow >16 bits,
> but taking a quick look IORING_CQE_BUFFER_SHIFT=16, so we only have
> 16 bits in cqe::flags for indexes we return.
>
Yea, the 16 bits return index in cqe->flags is a hard limit for
pbuf ring feature, but I do think it's ok since 1<<16 is already big
next prev parent reply other threads:[~2022-06-14 3:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-13 10:11 [PATCH 0/3] io_uring: fixes for provided buffer ring Dylan Yudaken
2022-06-13 10:11 ` [PATCH 1/3] io_uring: fix index calculation Dylan Yudaken
2022-06-13 10:11 ` [PATCH 2/3] io_uring: fix types in provided buffer ring Dylan Yudaken
2022-06-13 10:11 ` [PATCH 3/3] io_uring: limit size of " Dylan Yudaken
2022-06-13 11:08 ` [PATCH 0/3] io_uring: fixes for " Hao Xu
2022-06-13 12:59 ` Pavel Begunkov
2022-06-13 13:16 ` Dylan Yudaken
2022-06-13 14:05 ` Pavel Begunkov
2022-06-14 3:47 ` Hao Xu [this message]
2022-06-13 12:49 ` 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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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