⚡ Bolt: [performance improvement] Use napi_alloc_skb for RX cache locality - #11
⚡ Bolt: [performance improvement] Use napi_alloc_skb for RX cache locality#11maxugly wants to merge 1 commit into
Conversation
Switched from dev_alloc_skb to napi_alloc_skb in sim_rx_dequeue. This takes advantage of NAPI's per-CPU cache locality. Co-authored-by: maxugly <64644401+maxugly@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe RX dequeue path now allocates skbs with the selected NAPI context, while retaining existing failure handling. Documentation records the corresponding network RX hotpath guidance. ChangesNAPI RX allocation
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request replaces the generic dev_alloc_skb allocator with the NAPI-specific napi_alloc_skb allocator in module/nata_blk.c to leverage per-CPU caches and improve performance in the network RX hotpath. Additionally, a corresponding learning entry has been added to .jules/bolt.md documenting this optimization. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
💡 What
Replaced
dev_alloc_skbwithnapi_alloc_skbin the network driver's RX path (sim_rx_dequeue). Added a journal entry to.jules/bolt.mddocumenting this optimization pattern.🎯 Why
sim_rx_dequeueoperates in a NAPI polling context. Calling a generic slab allocator likedev_alloc_skbin this hotpath causes cache thrashing. Usingnapi_alloc_skbleverages the NAPI per-CPU cache locality, reducing lock contention and significantly improving packet processing throughput.📊 Impact
Expected to increase packet processing performance and lower latency during bursts, as CPU cache thrashing on memory allocations is reduced.
🔬 Measurement
Run
sudo ./scripts/nata-bench-once.shto measure packet throughput and compare against baseline. Useperfto profile CPU usage and observe reduced overhead inkmem_cache_alloc_nodeand network RX softirqs.PR created automatically by Jules for task 9367426265710306481 started by @maxugly
Summary by CodeRabbit