Skip to content

docs(design): io_uring and rayon composition pipeline - #3651

Merged
oferchen merged 1 commit into
masterfrom
docs/io-uring-rayon-composition-1283
May 5, 2026
Merged

oferchen merged 1 commit into
masterfrom
docs/io-uring-rayon-composition-1283

Conversation

@oferchen

@oferchen oferchen commented May 5, 2026

Copy link
Copy Markdown
Owner

Summary

Adds docs/design/io-uring-rayon-composition.md defining how rayon CPU-parallel workers compose with single-thread async io_uring instances. Tracking issue #1283; implementation follow-up #1284.

Key sections

  • Problem statement: rayon worker calling submit_and_wait blocks the worker and oversubscribes the kernel when each worker holds its own ring.
  • Three composition models: A (per-worker rings), B (shared ring + dispatch thread), C (per-NUMA-node rings).
  • Recommendation: model B with the SQPOLL kernel thread filling the dispatcher role when available, falling back to a userspace reaper when SQPOLL is denied.
  • Dispatch model: rayon worker leases a ring from the session pool (Document oc release branding and enforce README validation #1409), submits non-blocking, continues. The reaper drives completions and releases registered-buffer slots.
  • Backpressure: per-worker local FIFO of size 4, then block on completion semaphore.
  • spawn_blocking interaction: daemon-only; CLI mode stays sync.
  • Memory model: registered-buffer lease lasts from submit to completion ack; ring owns memory, kernel pins pages, drop ordering documented.
  • Failure semantics: per-submit fallback to pread64/pwrite64, never per-session.
  • Activation: only when io_uring is active (Linux 5.6+, feature flag on, no seccomp).
  • SSH note: out of scope; SSH stdio path is unreachable for io_uring per Modularize package tooling and bandwidth limiter #1858.
  • Risks: SQPOLL CAP_SYS_NICE, ring-pool exhaustion at very high concurrency, registered-buffer pinning under memory pressure.

Wire-compat invariants confirmed (zero impact)

  • File-list ordering unchanged.
  • Checksum bytes bit-identical regardless of I/O backend.
  • Multiplex envelope framing unchanged.
  • Delta-token order preserved by the disk-commit thread.

Test plan

  • Documentation build renders the new file under docs/design/.
  • No code changes; CI fmt/clippy/nextest unaffected.
  • References cite real source lines (crates/fast_io/src/io_uring/..., crates/transfer/..., crates/match/..., crates/signature/..., crates/engine/src/concurrent_delta/...).

Defines how rayon CPU-parallel workers compose with single-thread
async io_uring instances. Recommends one ring per session (model B)
with the SQPOLL kernel thread as dispatcher when available. Locks in
non-blocking submission, registered-buffer ownership rules, local-queue
backpressure, and a per-submit fallback chain to pread64/pwrite64.
Wire-compat invariants confirmed unchanged.

Tracking: #1283. Implementation follow-up: #1284.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 5, 2026
@oferchen
oferchen merged commit a55891f into master May 5, 2026
8 checks passed
@oferchen
oferchen deleted the docs/io-uring-rayon-composition-1283 branch May 5, 2026 09:59
oferchen added a commit that referenced this pull request May 18, 2026
Defines how rayon CPU-parallel workers compose with single-thread
async io_uring instances. Recommends one ring per session (model B)
with the SQPOLL kernel thread as dispatcher when available. Locks in
non-blocking submission, registered-buffer ownership rules, local-queue
backpressure, and a per-submit fallback chain to pread64/pwrite64.
Wire-compat invariants confirmed unchanged.

Tracking: #1283. Implementation follow-up: #1284.
oferchen added a commit that referenced this pull request Aug 24, 2026
Defines how rayon CPU-parallel workers compose with single-thread
async io_uring instances. Recommends one ring per session (model B)
with the SQPOLL kernel thread as dispatcher when available. Locks in
non-blocking submission, registered-buffer ownership rules, local-queue
backpressure, and a per-submit fallback chain to pread64/pwrite64.
Wire-compat invariants confirmed unchanged.

Tracking: #1283. Implementation follow-up: #1284.
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