Skip to content

perf(io): construct submission status after SQE preparation - #31

Merged
thweetkomputer merged 1 commit into
eloqdata:mainfrom
thweetkomputer:perf/io-status-construction
Nov 3, 2026
Merged

thweetkomputer merged 1 commit into
eloqdata:mainfrom
thweetkomputer:perf/io-status-construction

Conversation

@thweetkomputer

Copy link
Copy Markdown
Contributor

Constructing the shared absl::Status before 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 prepared flag records whether the fast path filled an SQE. Only requests that were not prepared call QueuePrepared. 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:

cmake --build build-testcases --parallel 4
ctest --test-dir build-testcases --output-on-failure
cmake --build build-testcases-bypass --parallel 4
ctest --test-dir build-testcases-bypass --output-on-failure
pre-commit run --files src/io/io_uring_backend.cpp

The test builds use CMAKE_BUILD_TYPE=Debug and BYCORF_BUILD_EXAMPLES=OFF; bypass additionally uses BYCORF_KERNEL_BYPASS=ON. All 96 normal and 123 bypass-capable tests passed. Formatting and whitespace checks passed.

GCC 13.3/AArch64 -O3 static comparison used actual tcp_stream.cpp, storage.cpp and io_uring_backend.cpp in an isolated link with and without LTO. The final implementation matches the compiled experiment except comments and whitespace:

  • With LTO, successful WriteOperation::await_suspend paths 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.
  • Without LTO, IoUringBackend::SubmitSend remains 80 instructions with a 32-byte frame and no stack protector in that backend function. The caller's existing checks remain.
  • The prepared flag 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.

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.
@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1442d750-f7a6-4bed-95fe-338e3430394e
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@thweetkomputer
thweetkomputer merged commit 7c37743 into eloqdata:main Nov 3, 2026
10 checks passed
@thweetkomputer
thweetkomputer deleted the perf/io-status-construction branch November 3, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant