Refactor UringEngine: Decouple submission queue push from kernel submission#616
Merged
Refactor UringEngine: Decouple submission queue push from kernel submission#616
Conversation
…ission This change refactors the io_uring submission flow to improve thread safety and simplify the concurrency model by separating the submission queue (SQ) operations from kernel submission operations. Changes: - Renamed `push_and_submit()` to `push_to_sq()` to reflect that it only adds entries to the submission queue without triggering kernel submission - Moved kernel submission (`submitter.submit()`) into `wait_for_completion()`, where it's called before `cq.sync()` to ensure pending submissions are sent - Updated all call sites to use the new `push_to_sq()` method Rationale: - The previous architecture submitted I/O operations to the kernel immediately after pushing to the submission queue, which required careful locking semantics - By deferring kernel submission until the completion queue is polled, we ensure that submissions are batched more efficiently - This change continues the ongoing work to remove UnsafeCell usage and improve the thread safety of the io_uring engine - The new flow is simpler: push to SQ → wait for completions → submit any pending operations to kernel → check completion queue This is part of the series of commits to refactor UringEngine and eliminate UnsafeCell, following the pattern established in #614 and #615.
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.
This change refactors the io_uring submission flow to improve thread safety and simplify the concurrency model by separating the submission queue (SQ) operations from kernel submission operations.
Changes:
push_and_submit()topush_to_sq()to reflect that it only adds entries to the submission queue without triggering kernel submissionsubmitter.submit()) intowait_for_completion(), where it's called beforecq.sync()to ensure pending submissions are sentpush_to_sq()methodRationale:
This is part of the series of commits to refactor UringEngine and eliminate UnsafeCell, following the pattern established in #614 and #615.