Skip to content
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

liburing, man: make io_uring_sqring_wait() more consistent with API #748

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dmantipov
Copy link
Contributor

Make io_uring_sqring_wait() return an amount of free SQ ring entries or -EINVAL if the ring was not setup with IORING_SETUP_SQPOLL, adjust manual page accordingly.

Signed-off-by: Dmitry Antipov [email protected]

@dmantipov
Copy link
Contributor Author

NOTE: IIUC this requires the following kernel change as well:

diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c
index 559652380672..7fc1b388ed90 100644
--- a/io_uring/sqpoll.c
+++ b/io_uring/sqpoll.c
@@ -327,7 +327,7 @@ int io_sqpoll_wait_sq(struct io_ring_ctx *ctx)
        } while (!signal_pending(current));
 
        finish_wait(&ctx->sqo_sq_wait, &wait);
-       return 0;
+       return io_sqring_entries(ctx);
 }
 
 __cold int io_sq_offload_create(struct io_ring_ctx *ctx,

src/include/liburing.h Outdated Show resolved Hide resolved
@dmantipov dmantipov force-pushed the liburing-man-make-io_uring_sqring_wait-more-consistent-with-api branch from 87148dd to 8d3bb0e Compare December 5, 2022 15:45
src/include/liburing.h Outdated Show resolved Hide resolved
@dmantipov dmantipov force-pushed the liburing-man-make-io_uring_sqring_wait-more-consistent-with-api branch from 8d3bb0e to ba0ef83 Compare December 5, 2022 16:15
Make io_uring_sqring_wait() return an amount of free SQ ring entries
or -EINVAL if the ring was not setup with IORING_SETUP_SQPOLL, adjust
manual page accordingly.

Signed-off-by: Dmitry Antipov <[email protected]>
@dmantipov dmantipov force-pushed the liburing-man-make-io_uring_sqring_wait-more-consistent-with-api branch from ba0ef83 to 711295e Compare December 5, 2022 16:22
@dmantipov dmantipov changed the title WIP: liburing, man: make io_uring_sqring_wait() more consistent with API liburing, man: make io_uring_sqring_wait() more consistent with API Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants