Repository navigation
docs(transport): investigate splice/vmsplice for SSH stdio - #3428
Merged
Merged
Conversation
Audit confirms upstream rsync 3.4.1 does not use splice. Identifies the file-to-pipe (sender) and pipe-to-file (receiver) edges as the only realistic targets for zero-copy on the SSH stdio path, since the parent does not own the SSH child's TCP socket. Documents the multiplex envelope constraint (4-byte header + 24-bit payload) and proposes a three-phase plan: payload splice on the sender, payload splice on the receiver, and vmsplice for the header ring. Risks cover vmsplice page lifetime, SPLICE_F_NONBLOCK semantics, EPIPE on closed peers, and interaction with --bwlimit. Adds docs/perf-roadmap.md as the index.
Provides the criterion baseline for the SSH-stdio splice investigation. The Linux body runs a real read+write_all loop from a temp file through a drained pipe at three sizes (64 KiB, 1 MiB, 16 MiB), establishing the comparison point for the future splice driver. The splice_baseline slot is a placeholder that records a constant for now; follow-up #1861 wires the real fast_io::splice_pipe driver into that slot. Non-Linux targets compile to a no-op group so cargo bench succeeds on macOS and Windows.
oferchen
added a commit
that referenced
this pull request
May 1, 2026
* docs(transport): investigate splice()/vmsplice() for SSH stdio (#1860) Audit confirms upstream rsync 3.4.1 does not use splice. Identifies the file-to-pipe (sender) and pipe-to-file (receiver) edges as the only realistic targets for zero-copy on the SSH stdio path, since the parent does not own the SSH child's TCP socket. Documents the multiplex envelope constraint (4-byte header + 24-bit payload) and proposes a three-phase plan: payload splice on the sender, payload splice on the receiver, and vmsplice for the header ring. Risks cover vmsplice page lifetime, SPLICE_F_NONBLOCK semantics, EPIPE on closed peers, and interaction with --bwlimit. Adds docs/perf-roadmap.md as the index. * bench(fast_io): add splice_pipe benchmark skeleton (#1860) Provides the criterion baseline for the SSH-stdio splice investigation. The Linux body runs a real read+write_all loop from a temp file through a drained pipe at three sizes (64 KiB, 1 MiB, 16 MiB), establishing the comparison point for the future splice driver. The splice_baseline slot is a placeholder that records a constant for now; follow-up #1861 wires the real fast_io::splice_pipe driver into that slot. Non-Linux targets compile to a no-op group so cargo bench succeeds on macOS and Windows.
oferchen
added a commit
that referenced
this pull request
May 5, 2026
* docs(transport): investigate splice()/vmsplice() for SSH stdio (#1860) Audit confirms upstream rsync 3.4.1 does not use splice. Identifies the file-to-pipe (sender) and pipe-to-file (receiver) edges as the only realistic targets for zero-copy on the SSH stdio path, since the parent does not own the SSH child's TCP socket. Documents the multiplex envelope constraint (4-byte header + 24-bit payload) and proposes a three-phase plan: payload splice on the sender, payload splice on the receiver, and vmsplice for the header ring. Risks cover vmsplice page lifetime, SPLICE_F_NONBLOCK semantics, EPIPE on closed peers, and interaction with --bwlimit. Adds docs/perf-roadmap.md as the index. * bench(fast_io): add splice_pipe benchmark skeleton (#1860) Provides the criterion baseline for the SSH-stdio splice investigation. The Linux body runs a real read+write_all loop from a temp file through a drained pipe at three sizes (64 KiB, 1 MiB, 16 MiB), establishing the comparison point for the future splice driver. The splice_baseline slot is a placeholder that records a constant for now; follow-up #1861 wires the real fast_io::splice_pipe driver into that slot. Non-Linux targets compile to a no-op group so cargo bench succeeds on macOS and Windows.
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
Investigation for oc-rsync task #1860. Adds a written audit and a criterion bench skeleton so a follow-up implementer can land the real driver against a measured baseline.
target/interop/upstream-src/rsync-3.4.1/forsplice,vmsplice,tee(, andSPLICEreturns one match: an unrelatedchecktee()shell helper intestsuite/rsync.fns). This is a pure oc-rsync optimisation, no wire-protocol change.HEADER_LEN,MPLEX_BASE + MessageCode::Data, 24-bit payload length) sits in front of every chunk. Phase 1 keeps the header on awrite_alland splices only the payload; phase 3 moves the header onto avmsplice(SPLICE_F_GIFT)ring.Phased plan
read+write_allloop. Acceptance: bench delta vs the baseline reported incrates/fast_io/benches/splice_pipe.rs.vmsplice(SPLICE_F_GIFT)for the multiplex header. Requires a header-page ring with explicit lifetime tracking against the SSH child's drain.Out of scope: socket-to-pipe (handled by the SSH child), checksum/delta-token paths, compression paths.
Risks
vmsplice page lifetime,
SPLICE_F_NONBLOCKsemantics, short splice returns,EPIPEon closed peer, default 64 KiB pipe capacity (F_SETPIPE_SZlift), interaction with--bwlimituser-space pacing. Each is enumerated with a mitigation in the audit doc.Files
docs/audits/splice-ssh-stdio.md- full audit with ASCII flow diagram, phased plan, risks, and follow-up task list.docs/perf-roadmap.md- new index file linking to this audit.crates/fast_io/benches/splice_pipe.rs- criterion bench skeleton with a realread_write_baseline(Linux) and asplice_baselineplaceholder slot. Non-Linux targets compile to a no-op group.crates/fast_io/Cargo.toml- register the new bench.Test plan
cargo bench -p fast_io --bench splice_pipesucceeds on Linux and prints the placeholder notice on the splice slot.cargo build --benches -p fast_iosucceeds on macOS / Windows.Tracking: oc-rsync #1860. Follow-ups: #1861 (driver), #1862 (sender wiring), #1863 (receiver mirror), #1864 (vmsplice header ring), #1865 (Linux bench suite), #1866 (io_uring chooser), #1867 (interop byte-identity).