Repository navigation
Queue io_uring and SPDK submissions under I/O backpressure - #16
Merged
Merged
Conversation
Defer accepted operations without reentrant completion dispatch, preserve cancellation and raw-fd lifetimes, and keep worker loops advancing pending work. Route listener shutdown to its owner worker and isolate submission and completion slow paths. Validate tiny-ring backpressure, cancellation, fd reuse, storage reads, and startup/shutdown races with the io_uring and runtime checks.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The MSG_RING target uses DEFER_TASKRUN. Polling CQEs alone can leave its task work pending on newer kernels; call Submit before Poll to match the worker loop. Keep the existing deadline and pre-submission assertions.
Pass synchronous preparation callbacks to SubmitOrQueue so ordinary requests write into the ring instead of zeroing and copying a temporary 64-byte SQE. Keep queued descriptor preparation in a separate non-inlined frame, preserve FIFO admission, and share the returned Status with that slow path to avoid a protected temporary in GCC's common path. Track cancels at their call site. Keep timeout arguments caller-owned and allocate fallback receive buffers before advancing the SQ tail. Extend the small-ring regression with mixed send/sendmsg submissions across direct and queued admission.
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.
Parallel I/O bursts can exhaust io_uring SQ space or SPDK request descriptors. Queue accepted work until capacity returns, and remove the shared 4096-object SPDK callback pool that could make one busy qpair reject work for another.
Changes
Each unfinished storage operation requires its own completion tag; callbacks may reuse or destroy it. The successful byte count now lives in IoCompletion, so consumers must rebuild. On the tested AArch64 layout, common storage awaitables grow by 8 bytes. Software queues grow with available memory.
Validation
All checks passed using this checkout in the Lavik workspace:
The first build is Debug; the second is RelWithDebInfo with BYCORF_KERNEL_BYPASS=ON. The SPDK regression runs the production backend against link-time device stubs and covers 8193-request queued/in-flight bursts, independent qpairs, FIFO retries, callback tag reuse/self-destruction, channel changes, and shutdown draining. No NVMe hardware throughput or tail-latency benchmark was run.
The io_uring regression also mixes send and sendmsg operations across direct SQ admission and the pending FIFO, checking completion counts, payload order, and retained caller-owned arguments.
An ARM64 GCC 13.3 Release disassembly comparison against b47fb60, using both a non-LTO object and a small LTO probe, confirms that Send/SendMsg no longer construct or copy a temporary 64-byte SQE on the normal path. Those paths also have no helper calls, cancel-opcode checks, or stack-canary overhead. The probe was used only for disassembly; this does not establish an end-to-end QPS gain.
The changed C++ files also passed clang-format 23.1.1 through pre-commit, and the diff passed whitespace checks.