]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: add sk->sk_drop_counters
authorEric Dumazet <edumazet@google.com>
Tue, 26 Aug 2025 12:50:29 +0000 (12:50 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 28 Aug 2025 11:14:50 +0000 (13:14 +0200)
commitc51613fa276f038bdd18656a57a90ccc5d4e5200
tree114a352c439984a17a8c3c44538cfa57a11f3575
parentcb4d5a6eb600a43c2e3ec7f54e06d07aa33d8062
net: add sk->sk_drop_counters

Some sockets suffer from heavy false sharing on sk->sk_drops,
and fields in the same cache line.

Add sk->sk_drop_counters to:

- move the drop counter(s) to dedicated cache lines.
- Add basic NUMA awareness to these drop counter(s).

Following patches will use this infrastructure for UDP and RAW sockets.

sk_clone_lock() is not yet ready, it would need to properly
set newsk->sk_drop_counters if we plan to use this for TCP sockets.

v2: used Paolo suggestion from https://lore.kernel.org/netdev/8f09830a-d83d-43c9-b36b-88ba0a23e9b2@redhat.com/

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20250826125031.1578842-4-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/net/sock.h
net/core/sock.c