docs(design): bound io_uring bgid u16 namespace exhaustion (#2044)#3711
Merged
Conversation
Document the 16-bit io_uring buffer-group-id namespace surface, the absence of an in-tree allocator today, theoretical and practical exhaustion bounds, a free-list recycler proposal with generation guard, hard-cap fallback to non-PBUF_RING I/O, and the unit and integration test plan. Cross-references #2045 adaptive sizing as the orthogonal per-ring concern.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…3711) Document the 16-bit io_uring buffer-group-id namespace surface, the absence of an in-tree allocator today, theoretical and practical exhaustion bounds, a free-list recycler proposal with generation guard, hard-cap fallback to non-PBUF_RING I/O, and the unit and integration test plan. Cross-references #2045 adaptive sizing as the orthogonal per-ring concern.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bgidnamespace exposed byIORING_REGISTER_PBUF_RING(max 65 536 distinct provided-bufferrings per
io_uring_fd).crates/fast_io/src/io_uring/buffer_ring.rs:no central allocator, public
bgid: u16field defaulting to0,no in-tree caller outside the unit tests in the same file.
BgidAllocatorwithBgidLease, generationcounter for defence-in-depth, and a typed
BgidExhaustederror socallers can fall back to non-PBUF_RING I/O at the hard cap.
(
docs/design/iouring-session-ring-pool.md) and the adaptivesizing audit (Align cross-compile matrix with build_daemon metadata #2045) as the orthogonal per-ring concern.
Why now
Today the namespace is unused because no in-tree caller constructs a
BufferRingoutside its own unit tests. As soon as the session-pooldesign or per-file PBUF_RING work lands, callers will start minting
bgidvalues. Without a recycler, a long-running daemon would hit-EEXISTafter 65 536 cumulative file transfers per io_uring fdeven though the live working set is tiny.
Doc
docs/design/io-uring-bgid-namespace.md- 434 lines, ten sections:problem statement, current allocation policy, current safety net,
theoretical thresholds, realistic scenarios, recycler design, hard
cap and fallback, test strategy, cross-reference to #2045, open
questions.
Test plan
grep -ni -E 'claude|internal|internal docs\.md' docs/design/io-uring-bgid-namespace.mdreturns empty.grep -nE '—|–' docs/design/io-uring-bgid-namespace.mdreturns empty.fmt+clippyandnextestto beunaffected by the doc.