Batch SQE submission#36
Merged
Merged
Conversation
Collaborator
vadimskipin
commented
May 10, 2026
There was a problem hiding this comment.
Pull request overview
This PR introduces bounded batching for io_uring SQE submission in the fiber scheduler to reduce syscall frequency and improve high-concurrency tail latency, and updates the performance documentation accordingly.
Changes:
- Add threshold-gated
submitIo(flush)to batch SQEs and amortizeio_uring_submitacross multiple fibers. - Force-flush partial batches at dispatch/steal boundaries and in latency-sensitive paths (wakeup/proxy).
- Update
docs/perf.mdbenchmark results and latency-profiler explanations to reflect the new submission model.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/fibers/fiber.cpp |
Implements threshold-based SQE batching, adds forced flush points, and moves IO submit profiling into submitIo(). |
docs/perf.md |
Refreshes net-perf metrics and updates the latency-profiler narrative for dispatch-batch submission. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+884
to
898
| if (profiler) | ||
| { | ||
| uint64_t startCycles = Tsc::getCycles(); | ||
|
|
||
| int r = ::io_uring_submit(&ring); | ||
| SILK_ASSERT(r >= 0); | ||
|
|
||
| profileEvent(ProfileEventKind::IO_SUBMIT, 0, Tsc::getCycles() - startCycles); | ||
| } | ||
| else | ||
| { | ||
| int r = ::io_uring_submit(&ring); | ||
| SILK_ASSERT(r >= 0); | ||
| } | ||
|
|
Comment on lines
+850
to
+852
| // flush=false (default): pressure-relief mode for dispatch loops -- only | ||
| // submit once at least IO_URING_FLUSH_THRESHOLD SQEs are queued, otherwise | ||
| // let the next fiber accumulate more work before paying the syscall. |
Comment on lines
+858
to
+860
| // IO_SUBMIT profile event represents the syscall cost; per-fiber latency | ||
| // lives in IO_WAIT. Category 0 because a single io_uring_enter covers SQEs | ||
| // from any fibers that contributed. |
6eab67b to
5814c2f
Compare
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.