Re: [PATCH net-next v2] net: devmem: convert binding refcount to percpu_ref
From: Bobby Eshleman
Date: Tue Dec 02 2025 - 17:36:05 EST
On Tue, Dec 02, 2025 at 11:34:17AM -0800, Bobby Eshleman wrote:
> From: Bobby Eshleman <bobbyeshleman@xxxxxxxx>
>
> Convert net_devmem_dmabuf_binding refcount from refcount_t to percpu_ref
> to optimize common-case reference counting on the hot path.
>
> The typical devmem workflow involves binding a dmabuf to a queue
> (acquiring the initial reference on binding->ref), followed by
> high-volume traffic where every skb fragment acquires a reference.
> Eventually traffic stops and the unbind operation releases the initial
> reference. Additionally, the high traffic hot path is often multi-core.
> This access pattern is ideal for percpu_ref as the first and last
> reference during bind/unbind normally book-ends activity in the hot
> path.
>
> __net_devmem_dmabuf_binding_free becomes the percpu_ref callback invoked
> when the last reference is dropped.
>
My apologies for sending this out after net-next closed. Won't happen
again.
Best,
Bobby