Skip to content

docs(design): io_uring per-thread rings + work stealing (#2243) - #4225

Merged
oferchen merged 1 commit into
masterfrom
docs/iouring-per-thread-rings-design-2243
May 17, 2026
Merged

oferchen merged 1 commit into
masterfrom
docs/iouring-per-thread-rings-design-2243

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Adds docs/design/iouring-per-thread-rings.md for task Guard env mutations in fallback tests #2243.
  • Documents the current ring topology, the proposed per-thread + work-stealing alternative, the cross-ring submission hazards, the bench evidence still missing, and a recommendation.
  • Recommends deferring per-thread rings until the per-file vs shared ring bench harness exposes a shared+Mutex<RawIoUring> baseline row that proves the mutex (not ring construction) is the actual bottleneck.

Key findings

  • The Arc<Mutex<...>> over a single shared ring that Guard env mutations in fallback tests #2243 is asking to replace does not exist in tree today; it is a proposed design at docs/design/iouring-session-ring-pool.md:37-59. The actual shipping serialization is per-file ring construction, not lock contention.
  • Cross-ring SQE stealing is not feasible without either (a) demoting the stolen SQE to the unregistered slow path (since registered buffers and fixed-file tables are ring-scoped) or (b) synchronising state across rings with a mutex that defeats the design.
  • The acceptance bar from docs/audits/per-file-vs-shared-uring-ring.md:230-237 is >= 25% throughput uplift on the tiny-file shape; per-thread rings can only meet this if shared-ring mutex contention >= 20%, which is currently unmeasured.

Test plan

  • cargo fmt --all (no Rust changes; docs only).
  • Doc references verified against current line numbers in crates/fast_io/src/io_uring/.

Records the per-thread rings + work-stealing design space and
recommends deferring implementation until the per-file vs shared
ring bench harness exposes a shared+Mutex baseline row. Captures
why cross-ring SQE stealing is not feasible without demoting to
the unregistered fast path or reintroducing the mutex the design
is meant to avoid.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 17, 2026
@oferchen
oferchen merged commit c7bfc43 into master May 17, 2026
8 checks passed
oferchen added a commit that referenced this pull request May 18, 2026
Records the per-thread rings + work-stealing design space and
recommends deferring implementation until the per-file vs shared
ring bench harness exposes a shared+Mutex baseline row. Captures
why cross-ring SQE stealing is not feasible without demoting to
the unregistered fast path or reintroducing the mutex the design
is meant to avoid.
oferchen added a commit that referenced this pull request May 18, 2026
Records the per-thread rings + work-stealing design space and
recommends deferring implementation until the per-file vs shared
ring bench harness exposes a shared+Mutex baseline row. Captures
why cross-ring SQE stealing is not feasible without demoting to
the unregistered fast path or reintroducing the mutex the design
is meant to avoid.
@oferchen
oferchen deleted the docs/iouring-per-thread-rings-design-2243 branch May 19, 2026 19:27
oferchen added a commit that referenced this pull request Aug 24, 2026
Records the per-thread rings + work-stealing design space and
recommends deferring implementation until the per-file vs shared
ring bench harness exposes a shared+Mutex baseline row. Captures
why cross-ring SQE stealing is not feasible without demoting to
the unregistered fast path or reintroducing the mutex the design
is meant to avoid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant