netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/9]  inet_diag: remove three mutexes in diag dumps
@ 2024-01-22 11:25 Eric Dumazet
  2024-01-22 11:25 ` [PATCH net-next 1/9] sock_diag: annotate data-races around sock_diag_handlers[family] Eric Dumazet
                   ` (10 more replies)
  0 siblings, 11 replies; 30+ messages in thread
From: Eric Dumazet @ 2024-01-22 11:25 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: David Ahern, Kuniyuki Iwashima, Martin KaFai Lau, Guillaume Nault,
	netdev, eric.dumazet, Eric Dumazet

Surprisingly, inet_diag operations are serialized over a stack
of three mutexes, giving legacy /proc based files an unfair
advantage on modern hosts.

This series removes all of them, making inet_diag operations
(eg iproute2/ss) fully parallel.

1-2) Two first patches are adding data-race annotations
     and can be backported to stable kernels.

3-4) inet_diag_table_mutex can be replaced with RCU protection,
     if we add corresponding protection against module unload.

5-7) sock_diag_table_mutex can be replaced with RCU protection,
     if we add corresponding protection against module unload.

 8)  sock_diag_mutex is removed, as the old bug it was
     working around has been fixed more elegantly.

 9)  inet_diag_dump_icsk() can skip over empty buckets to reduce
     spinlock contention.

Eric Dumazet (9):
  sock_diag: annotate data-races around sock_diag_handlers[family]
  inet_diag: annotate data-races around inet_diag_table[]
  inet_diag: add module pointer to "struct inet_diag_handler"
  inet_diag: allow concurrent operations
  sock_diag: add module pointer to "struct sock_diag_handler"
  sock_diag: allow concurrent operations
  sock_diag: allow concurrent operation in sock_diag_rcv_msg()
  sock_diag: remove sock_diag_mutex
  inet_diag: skip over empty buckets

 include/linux/inet_diag.h |   1 +
 include/linux/sock_diag.h |  10 +++-
 net/core/sock_diag.c      | 120 +++++++++++++++++++++-----------------
 net/dccp/diag.c           |   1 +
 net/ipv4/inet_diag.c      | 101 ++++++++++++++++++--------------
 net/ipv4/raw_diag.c       |   1 +
 net/ipv4/tcp_diag.c       |   1 +
 net/ipv4/udp_diag.c       |   2 +
 net/mptcp/mptcp_diag.c    |   1 +
 net/netlink/diag.c        |   1 +
 net/packet/diag.c         |   1 +
 net/sctp/diag.c           |   1 +
 net/smc/smc_diag.c        |   1 +
 net/tipc/diag.c           |   1 +
 net/unix/diag.c           |   1 +
 net/vmw_vsock/diag.c      |   1 +
 net/xdp/xsk_diag.c        |   1 +
 17 files changed, 149 insertions(+), 97 deletions(-)

-- 
2.43.0.429.g432eaa2c6b-goog


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

end of thread, other threads:[~2024-01-23 14:40 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-22 11:25 [PATCH net-next 0/9] inet_diag: remove three mutexes in diag dumps Eric Dumazet
2024-01-22 11:25 ` [PATCH net-next 1/9] sock_diag: annotate data-races around sock_diag_handlers[family] Eric Dumazet
2024-01-22 16:29   ` Guillaume Nault
2024-01-22 22:36   ` Kuniyuki Iwashima
2024-01-22 11:25 ` [PATCH net-next 2/9] inet_diag: annotate data-races around inet_diag_table[] Eric Dumazet
2024-01-22 16:29   ` Guillaume Nault
2024-01-22 22:37   ` Kuniyuki Iwashima
2024-01-22 11:25 ` [PATCH net-next 3/9] inet_diag: add module pointer to "struct inet_diag_handler" Eric Dumazet
2024-01-22 16:58   ` Guillaume Nault
2024-01-22 22:38   ` Kuniyuki Iwashima
2024-01-22 11:25 ` [PATCH net-next 4/9] inet_diag: allow concurrent operations Eric Dumazet
2024-01-22 16:58   ` Guillaume Nault
2024-01-22 22:40   ` Kuniyuki Iwashima
2024-01-22 11:25 ` [PATCH net-next 5/9] sock_diag: add module pointer to "struct sock_diag_handler" Eric Dumazet
2024-01-22 17:24   ` Guillaume Nault
2024-01-22 22:44   ` Kuniyuki Iwashima
2024-01-22 11:26 ` [PATCH net-next 6/9] sock_diag: allow concurrent operations Eric Dumazet
2024-01-22 17:25   ` Guillaume Nault
2024-01-22 22:47   ` Kuniyuki Iwashima
2024-01-22 11:26 ` [PATCH net-next 7/9] sock_diag: allow concurrent operation in sock_diag_rcv_msg() Eric Dumazet
2024-01-22 17:25   ` Guillaume Nault
2024-01-22 22:51   ` Kuniyuki Iwashima
2024-01-22 11:26 ` [PATCH net-next 8/9] sock_diag: remove sock_diag_mutex Eric Dumazet
2024-01-22 21:38   ` Guillaume Nault
2024-01-22 22:55   ` Kuniyuki Iwashima
2024-01-22 11:26 ` [PATCH net-next 9/9] inet_diag: skip over empty buckets Eric Dumazet
2024-01-22 21:44   ` Guillaume Nault
2024-01-22 22:58   ` Kuniyuki Iwashima
2024-01-22 15:05 ` [PATCH net-next 0/9] inet_diag: remove three mutexes in diag dumps Willem de Bruijn
2024-01-23 14:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).