netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 net-next 00/11] af_unix: Remove spin_lock_nested() and convert to lock_cmp_fn.
@ 2024-06-10 22:34 Kuniyuki Iwashima
  2024-06-10 22:34 ` [PATCH v1 net-next 01/11] af_unix: Define locking order for unix_table_double_lock() Kuniyuki Iwashima
                   ` (10 more replies)
  0 siblings, 11 replies; 18+ messages in thread
From: Kuniyuki Iwashima @ 2024-06-10 22:34 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Kent Overstreet, Kuniyuki Iwashima, Kuniyuki Iwashima, netdev

This series removes spin_lock_nested() in AF_UNIX and instead
defines the locking orders as functions tied to each lock by
lockdep_set_lock_cmp_fn().

When the defined function returns a negative value, lockdep
considers it will not cause deadlock.  (See ->cmp_fn() in
check_deadlock() and check_prev_add().)


Kuniyuki Iwashima (11):
  af_unix: Define locking order for unix_table_double_lock().
  af_unix: Define locking order for U_LOCK_SECOND in
    unix_state_double_lock().
  af_unix: Don't retry after unix_state_lock_nested() in
    unix_stream_connect().
  af_unix: Define locking order for U_LOCK_SECOND in
    unix_stream_connect().
  af_unix: Don't acquire unix_state_lock() for sock_i_ino().
  af_unix: Remove U_LOCK_DIAG.
  af_unix: Remove U_LOCK_GC_LISTENER.
  af_unix: Remove U_RECVQ_LOCK_EMBRYO.
  af_unix: Set sk_peer_pid/sk_peer_cred locklessly for new socket.
  af_unix: Remove put_pid()/put_cred() in copy_peercred().
  af_unix: Don't use spin_lock_nested() in copy_peercred().

 include/net/af_unix.h |  14 -----
 net/unix/af_unix.c    | 134 +++++++++++++++++++++++++++---------------
 net/unix/diag.c       |  47 ++++-----------
 net/unix/garbage.c    |   8 +--
 4 files changed, 99 insertions(+), 104 deletions(-)

-- 
2.30.2


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

end of thread, other threads:[~2024-06-11  0:47 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-10 22:34 [PATCH v1 net-next 00/11] af_unix: Remove spin_lock_nested() and convert to lock_cmp_fn Kuniyuki Iwashima
2024-06-10 22:34 ` [PATCH v1 net-next 01/11] af_unix: Define locking order for unix_table_double_lock() Kuniyuki Iwashima
2024-06-10 22:43   ` Kent Overstreet
2024-06-10 23:38     ` Kuniyuki Iwashima
2024-06-10 23:50       ` Kent Overstreet
2024-06-10 23:58         ` Kuniyuki Iwashima
2024-06-11  0:30           ` Kent Overstreet
2024-06-11  0:47             ` Kuniyuki Iwashima
2024-06-10 22:34 ` [PATCH v1 net-next 02/11] af_unix: Define locking order for U_LOCK_SECOND in unix_state_double_lock() Kuniyuki Iwashima
2024-06-10 22:34 ` [PATCH v1 net-next 03/11] af_unix: Don't retry after unix_state_lock_nested() in unix_stream_connect() Kuniyuki Iwashima
2024-06-10 22:34 ` [PATCH v1 net-next 04/11] af_unix: Define locking order for U_LOCK_SECOND " Kuniyuki Iwashima
2024-06-10 22:34 ` [PATCH v1 net-next 05/11] af_unix: Don't acquire unix_state_lock() for sock_i_ino() Kuniyuki Iwashima
2024-06-10 22:34 ` [PATCH v1 net-next 06/11] af_unix: Remove U_LOCK_DIAG Kuniyuki Iwashima
2024-06-10 22:34 ` [PATCH v1 net-next 07/11] af_unix: Remove U_LOCK_GC_LISTENER Kuniyuki Iwashima
2024-06-10 22:34 ` [PATCH v1 net-next 08/11] af_unix: Remove U_RECVQ_LOCK_EMBRYO Kuniyuki Iwashima
2024-06-10 22:34 ` [PATCH v1 net-next 09/11] af_unix: Set sk_peer_pid/sk_peer_cred locklessly for new socket Kuniyuki Iwashima
2024-06-10 22:35 ` [PATCH v1 net-next 10/11] af_unix: Remove put_pid()/put_cred() in copy_peercred() Kuniyuki Iwashima
2024-06-10 22:35 ` [PATCH v1 net-next 11/11] af_unix: Don't use spin_lock_nested() " Kuniyuki Iwashima

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).