-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GIT PULL] Support using a ring exclusively via registered index #664
Conversation
d2afd2c
to
5ba0c3c
Compare
Josh, this hasn't been forgotten. Let's pick this back up when 2.3 is released shortly, ditto on the kernel page as we're now outside of the merge window and can focus on 6.2 changes. |
Just a reminder. The 6.3 merge window will come soon. Any update on this? |
Rebasing the kernel patch now. |
@joshtriplett Since the kernel patch is now staged for 6.3, can you update the liburing side too? |
Forgot to mention, it should also include a test verifying basic functionality and misuse. |
…ring In preparation for allowing register via a registered ring fd. Signed-off-by: Josh Triplett <josh@joshtriplett.org>
This avoids overwriting and leaking a registered ring fd. Signed-off-by: Josh Triplett <josh@joshtriplett.org>
5ba0c3c
to
9a00239
Compare
Updated. Looking into tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we have a new rule. Since commit:
9e2890d ("build: add liburing-ffi")
Adding a new exported function should also be reflected in liburing-ffi.map.
9a00239
to
5c25d3c
Compare
Done. |
5c25d3c
to
6117393
Compare
@axboe Added a test. Let me know if the test covers what you'd like covered. |
Forgot to mention about the CHANGELOG file. Add a note about this new API in the CHANGELOG file. The change can be |
3ad2983
to
8562a42
Compare
Use it if the kernel supports IORING_FEAT_REG_REG_RING and the user registered the ring fd. Signed-off-by: Josh Triplett <josh@joshtriplett.org>
…ndex Add io_uring_close_fd to close the ring fd, and perform all subsequent operations via registered index only. Require the kernel to support IORING_FEAT_REG_REG_RING, to allow for subsequent io_uring_register operations as well. Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Based on io_uring-test, modified to use io_uring_close_ring_fd. Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Make sure an io_uring_register operation works after io_uring_close_ring_fd. Also test various error paths. Tested on a kernel with IORING_REGISTER_USE_REGISTERED_RING support. Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Introduce the new internal flag INT_FLAG_REG_REG_RING, set when setting INT_FLAG_REG_RING if the kernel supports IORING_FEAT_REG_REG_RING. This allows all the register functions to just check INT_FLAG_REG_REG_RING. Suggested-by: Dylan Yudaken <dylany@meta.com> Signed-off-by: Josh Triplett <josh@joshtriplett.org>
8562a42
to
c0bcc54
Compare
@ammarfaizi2 Done. |
This provides the userspace corresponding to the kernel patch at
https://lore.kernel.org/io-uring/3cbedc531b633af4fe8632f7276aa843b5a54875.1664123680.git.josh@joshtriplett.org/T/
.
With this change, a caller of liburing can handle a ring internally without
leaving a file descriptor open that might disrupt its caller, which makes it
safer to retrofit existing libraries with strict compatibility requirements to
use
io_uring
.Libraries with even more stringent requirements (e.g. never even transiently
having a file descriptor open) will need two additional pieces:
io_uring_setup
to set up the ring directly as a registeredfile descriptor, without ever putting it in the file descriptor table.
mmap
via a registered file descriptor, such as viaan
io_uring_register
call.git request-pull output:
Click to show/hide pull request guidelines
Pull Request Guidelines
notification, use
[GIT PULL]
as a prefix in your PR title.Commit message format rules:
Signed-off-by
tag with your real name and email. For example:The description should be word-wrapped at 72 chars. Some things should
not be word-wrapped. They may be some kind of quoted text - long
compiler error messages, oops reports, Link, etc. (things that have a
certain specific format).
Note that all of this goes in the commit message, not in the pull
request text. The pull request text should introduce what this pull
request does, and each commit message should explain the rationale for
why that particular change was made. The git tree is canonical source
of truth, not github.
Each patch should do one thing, and one thing only. If you find yourself
writing an explanation for why a patch is fixing multiple issues, that's
a good indication that the change should be split into separate patches.
If the commit is a fix for an issue, add a
Fixes
tag with the issueURL.
Don't use GitHub anonymous email like this as the commit author:
Use a real email address!
Commit message example:
By submitting this pull request, I acknowledge that: