Accelerate sparse writes with SIMD-aware zero detection#1920
Merged
Conversation
5 tasks
oferchen
added a commit
that referenced
this pull request
May 6, 2026
* feat(fast_io): add io_uring RENAMEAT2 wrapper and kernel probe Wraps `IORING_OP_RENAMEAT` (kernel 5.11+) with a OnceLock-cached opcode probe and a borrowed-path argument struct mirroring the shared-ring and splice probe conventions. Re-exports the libc RENAME_NOREPLACE / RENAME_EXCHANGE / RENAME_WHITEOUT constants and provides: - `renameat2_supported()`: cached probe, short-circuits on `is_io_uring_available()`, then `IORING_REGISTER_PROBE` for opcode 35. - `RenameAt2Args<'a>`: borrowed CStr paths + dirfds + flags. - `build_renameat2_sqe()`: returns Unsupported when probe is false. - `build_renameat2_sqe_unchecked()`: SQE wiring exercised by tests. - `renameat2_blocking()`: synchronous submit + reap on a transient ring. Mirrored stubs in `io_uring_stub.rs` keep the cross-platform surface identical, with stub functions returning Unsupported. Linux-gated integration test in `crates/fast_io/tests/io_uring_renameat2.rs` exercises a real rename, RENAME_NOREPLACE rejection, and an exchange swap, skipping when the kernel probe reports unsupported. Closes #1920 Closes #1922 * fix(fast_io): use io::Error::other to satisfy clippy::io_other_error
3 tasks
oferchen
added a commit
that referenced
this pull request
May 13, 2026
Wire the existing IORING_OP_RENAMEAT (task #1920) and IORING_OP_LINKAT (task #1921) opcode wrappers into the temp-file commit and hardlink finalization paths respectively. On Linux 5.11+ with io_uring available, temp-file renames in DestinationWriteGuard::commit_named_temp_file() now submit an IORING_OP_RENAMEAT SQE instead of a synchronous rename(2) syscall. On Linux 5.15+ with io_uring available, hardlink creation in HardlinkApplyTracker, create_hard_link(), and the --link-dest path now submit an IORING_OP_LINKAT SQE instead of a synchronous link(2). Both paths fall back transparently to std::fs::rename / std::fs::hard_link on non-Linux platforms, older kernels, or when io_uring is disabled. Two new convenience functions in fast_io expose the try-or-fallback pattern: try_rename_via_io_uring() and try_hard_link_via_io_uring(), returning Option<io::Result<()>> so callers can fall through to the portable implementation when None is returned. Closes #1924, closes #1925.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
* feat(fast_io): add io_uring RENAMEAT2 wrapper and kernel probe Wraps `IORING_OP_RENAMEAT` (kernel 5.11+) with a OnceLock-cached opcode probe and a borrowed-path argument struct mirroring the shared-ring and splice probe conventions. Re-exports the libc RENAME_NOREPLACE / RENAME_EXCHANGE / RENAME_WHITEOUT constants and provides: - `renameat2_supported()`: cached probe, short-circuits on `is_io_uring_available()`, then `IORING_REGISTER_PROBE` for opcode 35. - `RenameAt2Args<'a>`: borrowed CStr paths + dirfds + flags. - `build_renameat2_sqe()`: returns Unsupported when probe is false. - `build_renameat2_sqe_unchecked()`: SQE wiring exercised by tests. - `renameat2_blocking()`: synchronous submit + reap on a transient ring. Mirrored stubs in `io_uring_stub.rs` keep the cross-platform surface identical, with stub functions returning Unsupported. Linux-gated integration test in `crates/fast_io/tests/io_uring_renameat2.rs` exercises a real rename, RENAME_NOREPLACE rejection, and an exchange swap, skipping when the kernel probe reports unsupported. Closes #1920 Closes #1922 * fix(fast_io): use io::Error::other to satisfy clippy::io_other_error
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Wire the existing IORING_OP_RENAMEAT (task #1920) and IORING_OP_LINKAT (task #1921) opcode wrappers into the temp-file commit and hardlink finalization paths respectively. On Linux 5.11+ with io_uring available, temp-file renames in DestinationWriteGuard::commit_named_temp_file() now submit an IORING_OP_RENAMEAT SQE instead of a synchronous rename(2) syscall. On Linux 5.15+ with io_uring available, hardlink creation in HardlinkApplyTracker, create_hard_link(), and the --link-dest path now submit an IORING_OP_LINKAT SQE instead of a synchronous link(2). Both paths fall back transparently to std::fs::rename / std::fs::hard_link on non-Linux platforms, older kernels, or when io_uring is disabled. Two new convenience functions in fast_io expose the try-or-fallback pattern: try_rename_via_io_uring() and try_hard_link_via_io_uring(), returning Option<io::Result<()>> so callers can fall through to the portable implementation when None is returned. Closes #1924, closes #1925.
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
memchr's SIMD fast pathsinternal docsmemchrdependency to the engine crate and lockfileTesting
https://chatgpt.com/codex/tasks/task_e_6909494455688323bae15b2a6ef747e8