Repository navigation
perf(io): implement per-core UMEM slab allocation and vectorized ring operations in AF_XDP - #177
Merged
Merged
Conversation
… operations in AF_XDP
vxfemboy
temporarily deployed
to
benchmark-approval
October 27, 2026 02:34 — with
GitHub Actions
Inactive
vxfemboy
temporarily deployed
to
benchmark-approval
October 27, 2026 02:34 — with
GitHub Actions
Inactive
vxfemboy
temporarily deployed
to
benchmark-approval
October 27, 2026 02:46 — with
GitHub Actions
Inactive
This branch was previously deployed
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.
Resolves #172
Summary
This PR resolves Issue #172 by eliminating centralized free-list contention and cross-core MESI cache-line invalidation in AF_XDP kernel-bypass networking. It introduces per-core
UmemSlabpartitioning, lock-free batch recycling betweenCompletionRingandFillRing, and vectorizes ring buffer batch operations.Changes
UmemSlabPartitioning (crates/yip-io/src/af_xdp.rs):UmemSlabmanaging disjoint, non-overlapping chunk partitions from a sharedUmemPoolmapping.UmemPool::create_slabsandUmemPool::new_slabsto construct and partition shared memory regions without lock contention.slab.chunk_sliceandslab.chunk_slice_mutwith strict bounds checking and memory isolation guarantees.UmemSlab::recycle_from_ringsto harvest completed chunk descriptors directly fromCompletionRingand push them intoFillRingin batch, spilling any surplus directly back to the thread-local slab without heap allocations.UmemSlab::populate_fill_ringfor fast batch priming of fill rings.FillRing,CompletionRing,RxRing, andTxRingwith power-of-two masked contiguous slice copies (copy_from_slice), boosting circular ring batch throughput from 1,438 Mops/s to 4,057 Mops/s (0.25 ns/op).bin/yipd/src/sharding.rs):UmemPoolinto per-worker slabs, adhering to real Linux kernelXDP_SHARED_UMEMrequirements.crates/yip-bench/benches/af_xdp_scale.rsto benchmarkUmemSlaballoc/free, ring-to-ring recycling, and single-pool multi-slab scaling across 1, 2, 4, and 8 worker threads.crates/yip-io/tests/umem_test.rsvalidating slab allocation, bounds, batching, recycling, ring wrap-around, and Send/Sync invariants.CHANGELOG.md,ROADMAP.md,README.md,docs/03-architecture.md, anddocs/05-benchmarking-and-performance.md.Benchmark Results (
af_xdp_scale)Verification
cargo test --workspace: All 387 unit + 98 integration tests pass cleanly.cargo clippy --workspace --all-targets -- -D warnings: Clean.cargo fmt --check: Clean.cargo shear: Clean.