io_uring improvements#167
Open
tavianator wants to merge 3 commits intosocketry:mainfrom
Open
Conversation
io_uring does not necessarily submit all the pending SQEs when you call io_uring_submit(). In particular, in the default configuration, an error while processing an SQE will cause the rest of the batch to be aborted. Even with IORING_SETUP_SUBMIT_ALL, some errors (like ENOMEM) will still lead to a short submit. Fix the accounting to keep selector->pending equal to the number of unsubmitted SQEs at all times, so that the entire queue can be flushed reliably.
This decreases the likelihood of a short submit.
This io_uring setup flag enables some kernel optimizations, but it also means we can't have wakeup() send a nop from a different thread. Instead, register an eventfd with the ring which we can wait on and wake remotely.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some
io_uringchanges, feel free to take some or all of these.I tried also adding
IORING_SETUP_DEFER_TASKRUNbut it didn't pass the test suite, I assume because withSINGLE_ISSUERwe're waiting withppoll()instead ofio_uring_enter()(and thus some task_work never runs).Types of Changes
Contribution