Skip to content

perf(io_uring): add fixed-fd registration, SQPOLL, and zero-copy flush - #2502

Merged
oferchen merged 3 commits into
masterfrom
perf/io-uring-advanced-opts
Feb 26, 2026
Merged

oferchen merged 3 commits into
masterfrom
perf/io-uring-advanced-opts

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Add IORING_REGISTER_FILES fd registration at open time, eliminating per-op file table lookups in the kernel (~50ns/SQE savings on high-fd processes)
  • Add IORING_SETUP_SQPOLL kernel polling support with automatic privilege-based fallback
  • Eliminate flush_buffer() heap allocation by passing buffer slice directly to batched writer (was to_vec() clone)
  • Update writer_from_file() to use build_ring() and try_register_fd() for consistent feature support
  • Keep stub API in sync with new IoUringConfig fields (register_files, sqpoll, sqpoll_idle_ms)

Test plan

  • cargo fmt --all -- --check passes
  • RUSTFLAGS="-D warnings" cargo clippy --workspace --all-targets --all-features --no-deps passes
  • 59/59 fast_io tests pass
  • 22,261/22,261 workspace tests pass
  • CI passes on Linux, macOS, and Windows

- Register file descriptors via IORING_REGISTER_FILES at open time,
  eliminating per-op file table lookups (~50ns/SQE on high-fd processes)
- Add IORING_SETUP_SQPOLL support with automatic fallback when
  CAP_SYS_NICE is unavailable
- Eliminate flush_buffer() heap allocation by passing the internal
  buffer slice directly to the batched writer instead of to_vec()
- Update writer_from_file() to use build_ring() and try_register_fd()
  for consistent feature support across all writer construction paths
- Keep stub API in sync with new IoUringConfig fields
…used mut

Split chained IoUring::builder().setup_sqpoll() call to avoid E0716
temporary lifetime error, and remove unnecessary mut on ring bindings
since submitter() only requires &self.
Add register_files, sqpoll, and sqpoll_idle_ms to 6 test config
initializers that are only compiled on Linux with #[cfg(test)].
@oferchen
oferchen merged commit 805d873 into master Feb 26, 2026
30 checks passed
@oferchen
oferchen deleted the perf/io-uring-advanced-opts branch February 26, 2026 23:49
oferchen added a commit that referenced this pull request May 1, 2026
#2502)

* perf(io_uring): add fixed-fd registration, SQPOLL, and zero-copy flush

- Register file descriptors via IORING_REGISTER_FILES at open time,
  eliminating per-op file table lookups (~50ns/SQE on high-fd processes)
- Add IORING_SETUP_SQPOLL support with automatic fallback when
  CAP_SYS_NICE is unavailable
- Eliminate flush_buffer() heap allocation by passing the internal
  buffer slice directly to the batched writer instead of to_vec()
- Update writer_from_file() to use build_ring() and try_register_fd()
  for consistent feature support across all writer construction paths
- Keep stub API in sync with new IoUringConfig fields

* fix(io_uring): fix Linux compilation errors for SQPOLL builder and unused mut

Split chained IoUring::builder().setup_sqpoll() call to avoid E0716
temporary lifetime error, and remove unnecessary mut on ring bindings
since submitter() only requires &self.

* fix(io_uring): add missing fields to all test IoUringConfig initializers

Add register_files, sqpoll, and sqpoll_idle_ms to 6 test config
initializers that are only compiled on Linux with #[cfg(test)].
oferchen added a commit that referenced this pull request May 5, 2026
#2502)

* perf(io_uring): add fixed-fd registration, SQPOLL, and zero-copy flush

- Register file descriptors via IORING_REGISTER_FILES at open time,
  eliminating per-op file table lookups (~50ns/SQE on high-fd processes)
- Add IORING_SETUP_SQPOLL support with automatic fallback when
  CAP_SYS_NICE is unavailable
- Eliminate flush_buffer() heap allocation by passing the internal
  buffer slice directly to the batched writer instead of to_vec()
- Update writer_from_file() to use build_ring() and try_register_fd()
  for consistent feature support across all writer construction paths
- Keep stub API in sync with new IoUringConfig fields

* fix(io_uring): fix Linux compilation errors for SQPOLL builder and unused mut

Split chained IoUring::builder().setup_sqpoll() call to avoid E0716
temporary lifetime error, and remove unnecessary mut on ring bindings
since submitter() only requires &self.

* fix(io_uring): add missing fields to all test IoUringConfig initializers

Add register_files, sqpoll, and sqpoll_idle_ms to 6 test config
initializers that are only compiled on Linux with #[cfg(test)].
oferchen added a commit that referenced this pull request May 21, 2026
Adds the end-to-end production-path bench harness for the parallel-
receive-delta promotion chain. PIP-6 is the third bench in the
sequence after BR-3i.f (#2502, apply-loop) and BR-3j.f (#2508,
post-DashMap re-bench).

Scope: drives a real oc-rsync client against a real oc-rsync daemon
over rsync:// loopback, on workload shapes calibrated to the Path B
dispatch boundary (file_count > 100 || total_size > 64 MiB) that
PIP-3+5 (PR #4666) wired into ReceiverContext::dispatch_receiver_strategy.

Comparison shape: same workload, two oc-rsync binaries (default-features
build vs --no-default-features --features 'zstd lz4 xattr iconv').
The no-parallel build trips the parallel_unavailable fallback path
in crates/transfer/src/receiver/mod.rs and always picks sequential.

Workload matrix:
- single_large_file (1x1 GiB, parallel by byte threshold)
- many_small_files (10_000x4 KiB, parallel by count)
- boundary_under (50 files, 32 MiB, sequential control)
- boundary_over (200 files, 32 MiB, parallel above count)
- mixed_directory (1_000 files, ~600 MiB, parallel)

Decision criteria:
- Win on >= 2 of 5 shapes (parallel_wall / sequential_wall <= 0.9)
- No shape regresses by more than 5%
- boundary_under within +/-3% (harness control)

Bench compiles; numbers capture is the follow-up. The section-4 table
in docs/design/parallel-receive-delta-default-on.md is the target for
the wall-clock data.
oferchen added a commit that referenced this pull request May 21, 2026
…#4679)

Adds the end-to-end production-path bench harness for the parallel-
receive-delta promotion chain. PIP-6 is the third bench in the
sequence after BR-3i.f (#2502, apply-loop) and BR-3j.f (#2508,
post-DashMap re-bench).

Scope: drives a real oc-rsync client against a real oc-rsync daemon
over rsync:// loopback, on workload shapes calibrated to the Path B
dispatch boundary (file_count > 100 || total_size > 64 MiB) that
PIP-3+5 (PR #4666) wired into ReceiverContext::dispatch_receiver_strategy.

Comparison shape: same workload, two oc-rsync binaries (default-features
build vs --no-default-features --features 'zstd lz4 xattr iconv').
The no-parallel build trips the parallel_unavailable fallback path
in crates/transfer/src/receiver/mod.rs and always picks sequential.

Workload matrix:
- single_large_file (1x1 GiB, parallel by byte threshold)
- many_small_files (10_000x4 KiB, parallel by count)
- boundary_under (50 files, 32 MiB, sequential control)
- boundary_over (200 files, 32 MiB, parallel above count)
- mixed_directory (1_000 files, ~600 MiB, parallel)

Decision criteria:
- Win on >= 2 of 5 shapes (parallel_wall / sequential_wall <= 0.9)
- No shape regresses by more than 5%
- boundary_under within +/-3% (harness control)

Bench compiles; numbers capture is the follow-up. The section-4 table
in docs/design/parallel-receive-delta-default-on.md is the target for
the wall-clock data.
oferchen added a commit that referenced this pull request Aug 24, 2026
…#4679)

Adds the end-to-end production-path bench harness for the parallel-
receive-delta promotion chain. PIP-6 is the third bench in the
sequence after BR-3i.f (#2502, apply-loop) and BR-3j.f (#2508,
post-DashMap re-bench).

Scope: drives a real oc-rsync client against a real oc-rsync daemon
over rsync:// loopback, on workload shapes calibrated to the Path B
dispatch boundary (file_count > 100 || total_size > 64 MiB) that
PIP-3+5 (PR #4666) wired into ReceiverContext::dispatch_receiver_strategy.

Comparison shape: same workload, two oc-rsync binaries (default-features
build vs --no-default-features --features 'zstd lz4 xattr iconv').
The no-parallel build trips the parallel_unavailable fallback path
in crates/transfer/src/receiver/mod.rs and always picks sequential.

Workload matrix:
- single_large_file (1x1 GiB, parallel by byte threshold)
- many_small_files (10_000x4 KiB, parallel by count)
- boundary_under (50 files, 32 MiB, sequential control)
- boundary_over (200 files, 32 MiB, parallel above count)
- mixed_directory (1_000 files, ~600 MiB, parallel)

Decision criteria:
- Win on >= 2 of 5 shapes (parallel_wall / sequential_wall <= 0.9)
- No shape regresses by more than 5%
- boundary_under within +/-3% (harness control)

Bench compiles; numbers capture is the follow-up. The section-4 table
in docs/design/parallel-receive-delta-default-on.md is the target for
the wall-clock data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant