docs(design): io_uring borrowed-slice vs registered-buffer copy (#2208)#4218
Merged
Conversation
Analyse whether the io_uring READ_FIXED path can hand consumers a borrowed slice into the registered buffer instead of copying into a heap Vec. Concludes that the lifetime contract is too brittle to expose safely and recommends keeping the current copy, with Arc<[u8]> indirection as the fallback if benchmarks ever justify the change.
oferchen
added a commit
that referenced
this pull request
May 17, 2026
Restructure the SEND_ZC design doc around the explicit 7-section scope: current send path with file:line citations across daemon, transfer, and rsync_io; SEND_ZC semantics with the two-CQE notification model; registered-buffer ownership; kernel-6.0 runtime probe via IORING_REGISTER_PROBE; loopback + small-file bench plan; recommendation to defer until the daemon TCP wiring (#1876) lands; and cross-references to #4217 / #4218 / #4220 / #2243.
3 tasks
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Analyse whether the io_uring READ_FIXED path can hand consumers a borrowed slice into the registered buffer instead of copying into a heap Vec. Concludes that the lifetime contract is too brittle to expose safely and recommends keeping the current copy, with Arc<[u8]> indirection as the fallback if benchmarks ever justify the change.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Restructure the SEND_ZC design doc around the explicit 7-section scope: current send path with file:line citations across daemon, transfer, and rsync_io; SEND_ZC semantics with the two-CQE notification model; registered-buffer ownership; kernel-6.0 runtime probe via IORING_REGISTER_PROBE; loopback + small-file bench plan; recommendation to defer until the daemon TCP wiring (#1876) lands; and cross-references to #4217 / #4218 / #4220 / #2243.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Analyse whether the io_uring READ_FIXED path can hand consumers a borrowed slice into the registered buffer instead of copying into a heap Vec. Concludes that the lifetime contract is too brittle to expose safely and recommends keeping the current copy, with Arc<[u8]> indirection as the fallback if benchmarks ever justify the change.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Restructure the SEND_ZC design doc around the explicit 7-section scope: current send path with file:line citations across daemon, transfer, and rsync_io; SEND_ZC semantics with the two-CQE notification model; registered-buffer ownership; kernel-6.0 runtime probe via IORING_REGISTER_PROBE; loopback + small-file bench plan; recommendation to defer until the daemon TCP wiring (#1876) lands; and cross-references to #4217 / #4218 / #4220 / #2243.
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
READ_FIXEDpath can hand consumers a borrowed&[u8]directly out of the registered buffer instead of copying into a heapVec<u8>(the copy atcrates/fast_io/src/io_uring/registered_buffers.rs:578-registered_buffers.rs:584).for<'a>callback API, enumerates the lifetime hazards (re-entrancy, short-read reassembly, out-of-order CQEs, cross-thread escape, eager recycling racing the kernel), and contrasts with anArc<[u8]>/Bytesindirection alternative that keeps the copy but removes the ownership headache.Arc<[u8]>indirection, not borrowed slices.Test plan
cargo fmt --allcleanfile:lineincrates/fast_io/src/io_uring/