From: Bobby Eshleman <bobbyeshleman@gmail.com>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Kuniyuki Iwashima <kuniyu@google.com>,
Willem de Bruijn <willemb@google.com>,
Neal Cardwell <ncardwell@google.com>,
David Ahern <dsahern@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Jonathan Corbet <corbet@lwn.net>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Shuah Khan <shuah@kernel.org>,
Donald Hunter <donald.hunter@gmail.com>,
Mina Almasry <almasrymina@google.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arch@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kselftest@vger.kernel.org,
Stanislav Fomichev <sdf@fomichev.me>,
Bobby Eshleman <bobbyeshleman@meta.com>
Subject: Re: [PATCH net-next v7 0/5] net: devmem: improve cpu cost of RX token management
Date: Tue, 9 Dec 2025 11:52:31 -0800 [thread overview]
Message-ID: <aTh9/waV23uRZc9E@devvm11784.nha0.facebook.com> (raw)
In-Reply-To: <20251119-scratch-bobbyeshleman-devmem-tcp-token-upstream-v7-0-1abc8467354c@meta.com>
On Wed, Nov 19, 2025 at 07:37:07PM -0800, Bobby Eshleman wrote:
> This series improves the CPU cost of RX token management by adding an
> attribute to NETDEV_CMD_BIND_RX that configures sockets using the
> binding to avoid the xarray allocator and instead use a per-binding niov
> array and a uref field in niov.
>
> Improvement is ~13% cpu util per RX user thread.
>
> Using kperf, the following results were observed:
>
> Before:
> Average RX worker idle %: 13.13, flows 4, test runs 11
> After:
> Average RX worker idle %: 26.32, flows 4, test runs 11
>
> Two other approaches were tested, but with no improvement. Namely, 1)
> using a hashmap for tokens and 2) keeping an xarray of atomic counters
> but using RCU so that the hotpath could be mostly lockless. Neither of
> these approaches proved better than the simple array in terms of CPU.
>
> The attribute NETDEV_A_DMABUF_AUTORELEASE is added to toggle the
> optimization. It is an optional attribute and defaults to 0 (i.e.,
> optimization on).
>
[...]
>
> Changes in v7:
> - use netlink instead of sockopt (Stan)
> - restrict system to only one mode, dmabuf bindings can not co-exist
> with different modes (Stan)
> - use static branching to enforce single system-wide mode (Stan)
> - Link to v6: https://lore.kernel.org/r/20251104-scratch-bobbyeshleman-devmem-tcp-token-upstream-v6-0-ea98cf4d40b3@meta.com
>
Mina, I was wondering if you had any feedback on this approach?
Best,
Bobby
next prev parent reply other threads:[~2025-12-09 19:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-20 3:37 [PATCH net-next v7 0/5] net: devmem: improve cpu cost of RX token management Bobby Eshleman
2025-11-20 3:37 ` [PATCH net-next v7 1/5] net: devmem: rename tx_vec to vec in dmabuf binding Bobby Eshleman
2025-11-20 3:37 ` [PATCH net-next v7 2/5] net: devmem: refactor sock_devmem_dontneed for autorelease split Bobby Eshleman
2025-11-20 3:37 ` [PATCH net-next v7 3/5] net: devmem: implement autorelease token management Bobby Eshleman
2025-11-20 12:19 ` Paolo Abeni
2025-11-20 15:31 ` Bobby Eshleman
2025-11-21 16:39 ` Stanislav Fomichev
2025-11-21 17:58 ` [PATCH net-next v7 3/5] net: devmem: implement autorelease token managementy Bobby Eshleman
2025-11-26 10:11 ` [PATCH net-next v7 3/5] net: devmem: implement autorelease token management Simon Horman
2025-11-20 3:37 ` [PATCH net-next v7 4/5] net: devmem: document NETDEV_A_DMABUF_AUTORELEASE netlink attribute Bobby Eshleman
2025-11-20 3:37 ` [PATCH net-next v7 5/5] selftests: drv-net: devmem: add autorelease tests Bobby Eshleman
2025-11-26 10:02 ` Simon Horman
2025-12-09 19:52 ` Bobby Eshleman [this message]
2025-12-09 19:55 ` [PATCH net-next v7 0/5] net: devmem: improve cpu cost of RX token management 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=aTh9/waV23uRZc9E@devvm11784.nha0.facebook.com \
--to=bobbyeshleman@gmail.com \
--cc=almasrymina@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=arnd@arndb.de \
--cc=bobbyeshleman@meta.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=willemb@google.com \
/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