Repository navigation
perf(io): construct submission status after SQE preparation - #31
Merged
thweetkomputer merged 1 commit intoNov 3, 2026
Merged
Conversation
Keep one named return object for fast and queued submissions, but construct it after direct preparation. GCC LTO can then eliminate successful send status stack traffic without adding a protected stack temporary in the non-LTO backend. Run the existing suites without new tests: 96 normal and 123 bypass-capable tests pass. The isolated AArch64 GCC 13 O3 LTO send success paths lose four instructions; non-LTO SubmitSend retains its instruction count and frame.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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.
Constructing the shared
absl::Statusbefore SQE preparation leaves a status stack write, reload and success check in the LTO-inlined network send path. Construct it after direct SQE preparation instead, retaining the same named return object and slow-path output parameter.A local
preparedflag records whether the fast path filled an SQE. Only requests that were not prepared callQueuePrepared. Initialization checks, FIFO priority, capacity checks, error results and the rule against inline submission/completion are unchanged. The source comment explains why construction order matters and why a separate by-value slow-path Status return is avoided.No new tests are added: existing submission, backpressure, cancellation, shutdown and error tests exercise the same behavior. Validation from Bycorf:
The test builds use
CMAKE_BUILD_TYPE=DebugandBYCORF_BUILD_EXAMPLES=OFF; bypass additionally usesBYCORF_KERNEL_BYPASS=ON. All 96 normal and 123 bypass-capable tests passed. Formatting and whitespace checks passed.GCC 13.3/AArch64
-O3static comparison used actualtcp_stream.cpp,storage.cppandio_uring_backend.cppin an isolated link with and without LTO. The final implementation matches the compiled experiment except comments and whitespace:WriteOperation::await_suspendpaths shrink from 67 to 63 instructions for ordinary descriptors and from 69 to 65 for fixed descriptors. Status stack traffic and the success check remain only on the queueing/error path. Calls are counted once without expanding callees.IoUringBackend::SubmitSendremains 80 instructions with a 32-byte frame and no stack protector in that backend function. The caller's existing checks remain.preparedflag does not materialize in memory in these optimized artifacts. Whole LTO function size remains 112 instructions because cold-path handling remains present.This is static code-generation evidence, not a hardware throughput or latency measurement. The LTO experiment covers the normal configuration, not a full production server link. This PR is independently based on main and does not include the SPDK sector arithmetic change.