Why is the provided buffer group ID only a u16? #1480
Unanswered
tiptenbrink
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Thanks for all the work on io_uring!
As we can see from the
io_uring_buf_regdefinition:bgid (buffer group ID) is only a u16, this means you can register at most 65536 different buffer groups. I feel a u32 would be a more natural choice here, because in the following situation you might run out of buffer groups:
Maybe when you are working with that number of connections you would probably just want a second ring, in that case I can understand why u16 was chosen.
I will admit an even better solution (but probably more complex) would be to somehow lock buffers within a provided buffer ring to only receive from a specific fd, or otherwise somehow make it so the kernel won't continue incrementally writing at a buffer when there is another multishot recv still incrementally consuming that one.
Beta Was this translation helpful? Give feedback.
All reactions