On Thu, Nov 5, 2026 at 8:36 AM Jesper Dangaard Brouer [off-list ref] wrote:
On 11/3/26 22:14, Mina Almasry wrote:
quoted
Remove the per-SKB skb->pp_recycle bitfield and skb_mark_for_recycle()
helper, and reference-count netmems directly by their underlying type
via netmem_is_pp() inside netmem_inc_ref() and netmem_dec_ref().
This series simplifies SKB and netmem reference counting:
- Reclaims 1 bit from struct sk_buff (skb->pp_recycle).
- Unifies reference counting of SKB fragment netmems and regular netmems
under netmem_inc_ref() and netmem_dec_ref(), eliminating the separate
skb_netmem_ref(), skb_netmem_unref(), and skb_mark_for_recycle() APIs.
Part of the performance gain from page_pool was to completely avoid the
atomic refcnt operation, when we can see that page refcnt==1.
Are you removing this?
I am not, and this is a very sharp observation, because retaining that
optimization was one of the things I struggled with my LLM to come up
with a way to retain that optimization without pp_recycle. Patch 4
includes verification from pp-bench that the fast path remains just as
fast:
- no-softirq-page_pool01 (fast path): 37 cycles (18.7 ns) baseline
vs 36-37 cycles (18.5 ns) patched.
- no-softirq-page_pool02 (ptr_ring): 77-78 cycles (38.9 ns)
baseline vs 76-77 cycles (38.4 ns) patched.
But the sashiko comments indicates there is at least 1 race related to
this we missed. It looks like a smp_rmb() after checking the page is
exclusively owned may fix it. Let me see if that works.
--
Thanks,
Mina