]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: remove cpu stall in txq_trans_update()
authorEric Dumazet <edumazet@google.com>
Tue, 8 Apr 2025 20:27:42 +0000 (20:27 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 10 Apr 2025 01:03:31 +0000 (18:03 -0700)
commit229671ac60e298b85c2644f52d7e487e9f487d06
treede47fc6ce5c2747e5774443dc8860e66d5c829b1
parent9c056ec6dd1654b1420dafbbe2a69718850e6ff2
net: remove cpu stall in txq_trans_update()

txq_trans_update() currently uses txq->xmit_lock_owner
to conditionally update txq->trans_start.

For regular devices, txq->xmit_lock_owner is updated
from HARD_TX_LOCK() and HARD_TX_UNLOCK(), and this apparently
causes cpu stalls.

Using dev->lltx, which sits in a read-mostly cache-line,
and already used in HARD_TX_LOCK() and HARD_TX_UNLOCK()
helps cpu prediction.

On an AMD EPYC 7B12 dual socket server, tcp_rr with 128 threads
and 30,000 flows gets a 5 % increase in throughput.

As explained in commit 95ecba62e2fd ("net: fix races in
netdev_tx_sent_queue()/dev_watchdog()") I am planning
to no longer update txq->trans_start in the fast path
in a followup patch.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250408202742.2145516-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/ti/am65-cpsw-nuss.c
include/linux/netdevice.h