Re: Device mem changes vs pinning/zerocopy changes

From
David Howells <dhowells@redhat.com>
Date
2025-06-04 14:56:14
Also in
linux-mm, lkml
Reply to
Stanislav Fomichev, 2025-05-30
Stanislav Fomichev [off-list ref] wrote:
quoted
 (1) Separate fragment lifetime management from sk_buff.  No more wangling
     of refcounts in the skbuff code.  If you clone an skb, you stick an
     extra ref on the lifetime management struct, not the page.
For device memory TCP we already have this: net_devmem_dmabuf_binding
is the owner of the frags. And when we reference skb frag we reference
only this owner, not individual chunks: __skb_frag_ref -> get_netmem ->
net_devmem_get_net_iov (ref on the binding).

Will it be possible to generalize this to cover MSG_ZEROCOPY and splice
cases? From what I can tell, this is somewhat equivalent of your net_txbuf.
Yes and no.  The net_devmem stuff that's now upstream still manages refs on a
per-skb-frag basis.  What I'm looking to do is to move it out of the skb and
into a separate struct so that the ref on a chunk of memory can be shared
between several skb-frags, quite possibly spread between several skbs.

This is especially important for various types of zerocopy memory where we
won't actually be allowed to take refs.

David
Thread (9 messages) 9 messages, 3 authors, last reply 2025-06-05
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