inet_diag: allow concurrent operations
authorEric Dumazet <edumazet@google.com>
Mon, 22 Jan 2024 11:25:58 +0000 (11:25 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 23 Jan 2024 14:13:54 +0000 (15:13 +0100)
commit223f55196bbdb182a9b8de6108a0834b5e5e832e
tree2d0871db63d5248827224188cc22c69a90dda2bf
parentdb5914695a84a7b128ec2e4e9272e6e8091753e1
inet_diag: allow concurrent operations

inet_diag_lock_handler() current implementation uses a mutex
to protect inet_diag_table[] array against concurrent changes.

This makes inet_diag dump serialized, thus less scalable
than legacy /proc files.

It is time to switch to full RCU protection.

As a bonus, if a target is statically linked instead of being
modular, inet_diag_lock_handler() & inet_diag_unlock_handler()
reduce to reads only.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/ipv4/inet_diag.c