lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250825195947.4073595-1-edumazet@google.com>
Date: Mon, 25 Aug 2025 19:59:44 +0000
From: Eric Dumazet <edumazet@...gle.com>
To: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, 
	Paolo Abeni <pabeni@...hat.com>
Cc: Simon Horman <horms@...nel.org>, netdev@...r.kernel.org, eric.dumazet@...il.com, 
	Willem de Bruijn <willemb@...gle.com>, Kuniyuki Iwashima <kuniyu@...gle.com>, 
	Eric Dumazet <edumazet@...gle.com>
Subject: [PATCH net-next 0/3] net: better drop accounting

Incrementing sk->sk_drops for every dropped packet can
cause serious cache line contention.

Move sk_drops into a separate cache line so that
the consumer reads packets faster.

Add sk->sk_drops1 field for basic NUMA awareness
at low memory cost.

Tested:
see the 2nd patch changelog for test setup.
(One UDP receiving socket)

Before:

Udp6InDatagrams                 615091             0.0
Udp6InErrors                    3904277            0.0
Udp6RcvbufErrors                3904277            0.0

After:

Udp6InDatagrams                 914537             0.0
Udp6InErrors                    6888487            0.0
Udp6RcvbufErrors                6888487            0.0

Eric Dumazet (3):
  net: add sk_drops_read(), sk_drops_inc() and sk_drops_reset() helpers
  net: move sk_drops out of sock_write_rx group
  net: add new sk->sk_drops1 field

 include/net/sock.h                            | 43 +++++++++++++++++--
 include/net/tcp.h                             |  2 +-
 net/core/datagram.c                           |  2 +-
 net/core/sock.c                               | 15 +++----
 net/ipv4/ping.c                               |  2 +-
 net/ipv4/raw.c                                |  6 +--
 net/ipv4/udp.c                                | 14 +++---
 net/ipv6/datagram.c                           |  2 +-
 net/ipv6/raw.c                                |  8 ++--
 net/ipv6/udp.c                                |  6 +--
 net/iucv/af_iucv.c                            |  4 +-
 net/netlink/af_netlink.c                      |  4 +-
 net/packet/af_packet.c                        |  2 +-
 net/phonet/pep.c                              |  6 +--
 net/phonet/socket.c                           |  2 +-
 net/sctp/diag.c                               |  2 +-
 net/tipc/socket.c                             |  6 +--
 .../selftests/bpf/progs/bpf_iter_netlink.c    |  3 +-
 .../selftests/bpf/progs/bpf_iter_udp4.c       |  2 +-
 .../selftests/bpf/progs/bpf_iter_udp6.c       |  2 +-
 20 files changed, 84 insertions(+), 49 deletions(-)

-- 
2.51.0.261.g7ce5a0a67e-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ