Skip to content

docs: audit io_uring fixed-buffer registration invariants#4022

Merged
oferchen merged 1 commit into
masterfrom
docs/io-uring-fixed-buffer-audit-2118
May 14, 2026
Merged

docs: audit io_uring fixed-buffer registration invariants#4022
oferchen merged 1 commit into
masterfrom
docs/io-uring-fixed-buffer-audit-2118

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • Adds docs/audits/io-uring-fixed-buffer-invariants-audit.md covering the operational invariants of RegisteredBufferGroup at crates/fast_io/src/io_uring/registered_buffers.rs.
  • Maps each invariant - registration at ring setup, silent fallback to unfixed IORING_OP_READ / IORING_OP_WRITE, page-pinning for the ring's lifetime, default sizing vs kernel limits, drop ordering, and kernel-side unregister on ring fd close - to a single file:line citation with an OK / GAP / UNKNOWN status verdict.
  • Records one minor GAP: IoUringWriter::with_ring at crates/fast_io/src/io_uring/file_writer.rs:118 ignores IoUringConfig::register_buffers and hard-codes count = 8. A scoped plumbing fix is described inline; left to a separate follow-up PR.
  • Cross-references the related BgidAllocator work (task Remove outdated golden CLI version test #2044), provided-buffer-ring footprint (task Fix clippy warning in sparse executor test #1936), and engine local-copy buffer pool (task Align cross-compile matrix with build_daemon metadata #2045) audits.

Tracking issue: #2118. This audit complements the three existing siblings (io-uring-fixed-buffer-audit.md, io-uring-fixed-buffer-registration.md, iouring-fixed-buffer-registration.md) by collapsing the findings into a single invariants checklist rather than narrative form.

Docs-only PR. No code changes.

Test plan

  • CI markdown / link checks pass.
  • Reviewer spot-checks each file:line citation against the current tree (paths and line numbers verified at audit time; no code moved in this PR).

Add an invariants-table audit of `RegisteredBufferGroup` covering
registration timing, silent fallback to unfixed opcodes, page-pinning
ownership, default sizing vs kernel limits, drop ordering, and kernel
cleanup on ring fd close. Each invariant cites a single file:line
location with an OK / GAP / UNKNOWN status verdict. The one GAP -
`IoUringWriter::with_ring` ignoring the configured
`register_buffers` flag - is left to a follow-up PR with a scoped
plumbing fix described inline.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 14, 2026
@oferchen oferchen merged commit df0cc5f into master May 14, 2026
8 checks passed
@oferchen oferchen deleted the docs/io-uring-fixed-buffer-audit-2118 branch May 14, 2026 14:57
oferchen added a commit that referenced this pull request May 17, 2026
…ern (#4320)

The post-#4310 tests.rs at 882 lines exceeded the 650-line cap. Split
into a tests/ directory grouped by concern, each file well under cap:

- tests/mod.rs (39) - shared try_ring / try_group helpers and module decls.
- tests/registry.rs (113) - page size, validation guards, slot allocator.
- tests/submit.rs (179) - submit_read/write_fixed_batch helpers.
- tests/stats.rs (141) - acquire/miss counters and snapshot semantics.
- tests/status.rs (49) - try_new_with_status outcome reporting.
- tests/drop_contract.rs (309) - Drop semantics and constrained-env coverage
  for the PR #4022 / task #2118 fixed-buffer invariants audit.

The try_ring / try_group helpers replace the repeated match-or-return
boilerplate that handled environments where io_uring is unavailable
(CI sandboxes, seccomp, kernel < 5.6).

No behavioural change; test coverage is preserved.
oferchen added a commit that referenced this pull request May 18, 2026
Add an invariants-table audit of `RegisteredBufferGroup` covering
registration timing, silent fallback to unfixed opcodes, page-pinning
ownership, default sizing vs kernel limits, drop ordering, and kernel
cleanup on ring fd close. Each invariant cites a single file:line
location with an OK / GAP / UNKNOWN status verdict. The one GAP -
`IoUringWriter::with_ring` ignoring the configured
`register_buffers` flag - is left to a follow-up PR with a scoped
plumbing fix described inline.
oferchen added a commit that referenced this pull request May 18, 2026
…ern (#4320)

The post-#4310 tests.rs at 882 lines exceeded the 650-line cap. Split
into a tests/ directory grouped by concern, each file well under cap:

- tests/mod.rs (39) - shared try_ring / try_group helpers and module decls.
- tests/registry.rs (113) - page size, validation guards, slot allocator.
- tests/submit.rs (179) - submit_read/write_fixed_batch helpers.
- tests/stats.rs (141) - acquire/miss counters and snapshot semantics.
- tests/status.rs (49) - try_new_with_status outcome reporting.
- tests/drop_contract.rs (309) - Drop semantics and constrained-env coverage
  for the PR #4022 / task #2118 fixed-buffer invariants audit.

The try_ring / try_group helpers replace the repeated match-or-return
boilerplate that handled environments where io_uring is unavailable
(CI sandboxes, seccomp, kernel < 5.6).

No behavioural change; test coverage is preserved.
oferchen added a commit that referenced this pull request May 18, 2026
…ern (#4320)

The post-#4310 tests.rs at 882 lines exceeded the 650-line cap. Split
into a tests/ directory grouped by concern, each file well under cap:

- tests/mod.rs (39) - shared try_ring / try_group helpers and module decls.
- tests/registry.rs (113) - page size, validation guards, slot allocator.
- tests/submit.rs (179) - submit_read/write_fixed_batch helpers.
- tests/stats.rs (141) - acquire/miss counters and snapshot semantics.
- tests/status.rs (49) - try_new_with_status outcome reporting.
- tests/drop_contract.rs (309) - Drop semantics and constrained-env coverage
  for the PR #4022 / task #2118 fixed-buffer invariants audit.

The try_ring / try_group helpers replace the repeated match-or-return
boilerplate that handled environments where io_uring is unavailable
(CI sandboxes, seccomp, kernel < 5.6).

No behavioural change; test coverage is preserved.
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