Re: [PATCH v2 net-next 5/5] inet: raw: add drop_counters to raw sockets
From: Kuniyuki Iwashima <kuniyu@google.com>
Date: 2025-08-27 05:34:41
From: Kuniyuki Iwashima <kuniyu@google.com>
Date: 2025-08-27 05:34:41
On Tue, Aug 26, 2025 at 5:50 AM Eric Dumazet [off-list ref] wrote:
When a packet flood hits one or more RAW sockets, many cpus have to update sk->sk_drops. This slows down other cpus, because currently sk_drops is in sock_write_rx group. Add a socket_drop_counters structure to raw sockets. Using dedicated cache lines to hold drop counters makes sure that consumers no longer suffer from false sharing if/when producers only change sk->sk_drops. This adds 128 bytes per RAW socket. Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Thank you, Eric !