[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250902-scratch-bobbyeshleman-devmem-tcp-token-upstream-v1-0-d946169b5550@meta.com>
Date: Tue, 02 Sep 2025 14:36:26 -0700
From: Bobby Eshleman <bobbyeshleman@...il.com>
To: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
Kuniyuki Iwashima <kuniyu@...gle.com>,
Willem de Bruijn <willemb@...gle.com>, Neal Cardwell <ncardwell@...gle.com>,
David Ahern <dsahern@...nel.org>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Stanislav Fomichev <sdf@...ichev.me>, Mina Almasry <almasrymina@...gle.com>,
Bobby Eshleman <bobbyeshleman@...a.com>
Subject: [PATCH net-next 0/2] net: devmem: improve cpu cost of RX token
management
This series improves the CPU cost of RX token management by replacing
the xarray allocator with a normal array of atomics. Similar to devmem
TX's page-index lookup scheme for niovs, RX also uses page indices to
lookup the corresponding atomic in the array.
Improvement is ~5% per RX user thread.
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.
Signed-off-by: Bobby Eshleman <bobbyeshleman@...a.com>
---
Bobby Eshleman (2):
net: devmem: rename tx_vec to vec in dmabuf binding
net: devmem: use niov array for token management
include/net/sock.h | 5 ++-
net/core/devmem.c | 31 +++++++-------
net/core/devmem.h | 4 +-
net/core/sock.c | 24 +++++++----
net/ipv4/tcp.c | 107 +++++++++++++++--------------------------------
net/ipv4/tcp_ipv4.c | 40 +++++++++++++++---
net/ipv4/tcp_minisocks.c | 2 -
7 files changed, 107 insertions(+), 106 deletions(-)
---
base-commit: cd8a4cfa6bb43a441901e82f5c222dddc75a18a3
change-id: 20250829-scratch-bobbyeshleman-devmem-tcp-token-upstream-292be174d503
Best regards,
--
Bobby Eshleman <bobbyeshleman@...a.com>
Powered by blists - more mailing lists