Re: [PATCH net-next v1 0/5] net: deprecate skb->pp_recycle and skb_mark_for_recycle()

From
Mina Almasry <hidden>
Date
2026-11-06 17:53:20
Also in
bpf, imx, linux-doc, linux-hyperv, linux-mm, linux-omap, linux-rdma, linux-renesas-soc, lkml, virtualization
Reply to
Jesper Dangaard Brouer, 2026-11-05
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
Thread (9 messages) 9 messages, 3 authors, last reply 1d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help