From: David Howells <dhowells@redhat.com>
To: Stanislav Fomichev <stfomichev@gmail.com>
Cc: dhowells@redhat.com, Mina Almasry <almasrymina@google.com>,
willy@infradead.org, hch@infradead.org,
Jakub Kicinski <kuba@kernel.org>,
Eric Dumazet <edumazet@google.com>,
netdev@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: Device mem changes vs pinning/zerocopy changes
Date: Wed, 04 Jun 2025 15:56:01 +0100 [thread overview]
Message-ID: <1097885.1749048961@warthog.procyon.org.uk> (raw)
In-Reply-To: <aDnTsvbyKCTkZbOR@mini-arch>
Stanislav Fomichev <stfomichev@gmail.com> wrote:
> > (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
next prev parent reply other threads:[~2025-06-04 14:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-30 15:14 David Howells
2025-05-30 15:50 ` Stanislav Fomichev
2025-05-30 16:22 ` Mina Almasry
2025-06-04 14:56 ` David Howells [this message]
2025-06-05 18:59 ` Mina Almasry
2025-06-04 15:34 ` David Howells
2025-06-05 19:27 ` Mina Almasry
2025-06-04 15:59 ` David Howells
2025-06-05 19:30 ` Mina Almasry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1097885.1749048961@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=almasrymina@google.com \
--cc=edumazet@google.com \
--cc=hch@infradead.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=netdev@vger.kernel.org \
--cc=stfomichev@gmail.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox