public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] tcp: try to defer / return acked skbs to originating CPU
@ 2026-01-17 16:42 Jakub Kicinski
  2026-01-17 17:10 ` Jakub Kicinski
  2026-01-17 18:16 ` Eric Dumazet
  0 siblings, 2 replies; 15+ messages in thread
From: Jakub Kicinski @ 2026-01-17 16:42 UTC (permalink / raw)
  To: edumazet
  Cc: kuniyu, ncardwell, netdev, davem, pabeni, andrew+netdev, horms,
	Jakub Kicinski

Running a memcache-like workload under production(ish) load
on a 300 thread AMD machine we see ~3% of CPU time spent
in kmem_cache_free() via tcp_ack(), freeing skbs from rtx queue.
This workloads pins workers away from softirq CPU so
the Tx skbs are pretty much always allocated on a different
CPU than where the ACKs arrive. Try to use the defer skb free
queue to return the skbs back to where they came from.
This results in a ~4% performance improvement for the workload.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 include/net/tcp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index ef0fee58fde8..e290651da508 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -332,7 +332,7 @@ static inline void tcp_wmem_free_skb(struct sock *sk, struct sk_buff *skb)
 		sk_mem_uncharge(sk, skb->truesize);
 	else
 		sk_mem_uncharge(sk, SKB_TRUESIZE(skb_end_offset(skb)));
-	__kfree_skb(skb);
+	skb_attempt_defer_free(skb);
 }
 
 void sk_forced_mem_schedule(struct sock *sk, int size);
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-02-17 21:56 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-17 16:42 [PATCH net-next] tcp: try to defer / return acked skbs to originating CPU Jakub Kicinski
2026-01-17 17:10 ` Jakub Kicinski
2026-01-17 18:16 ` Eric Dumazet
2026-01-17 23:03   ` Jakub Kicinski
2026-01-18 12:15     ` Eric Dumazet
2026-01-19 17:04       ` Jakub Kicinski
2026-01-29 23:04         ` Jakub Kicinski
2026-01-29 23:10           ` Jakub Kicinski
2026-02-16 16:06           ` Eric Dumazet
2026-02-16 17:49             ` Jakub Kicinski
2026-02-16 17:58               ` Eric Dumazet
2026-02-16 18:11                 ` Jakub Kicinski
2026-02-16 18:16                   ` Eric Dumazet
2026-02-17 21:50                     ` Jakub Kicinski
2026-02-17 21:56                       ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox