From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Kent Overstreet <kent.overstreet@linux.dev>,
Kuniyuki Iwashima <kuniyu@amazon.com>,
Kuniyuki Iwashima <kuni1840@gmail.com>, <netdev@vger.kernel.org>
Subject: [PATCH v2 net-next 00/11] af_unix: Remove spin_lock_nested() and convert to lock_cmp_fn.
Date: Tue, 11 Jun 2024 15:28:54 -0700 [thread overview]
Message-ID: <20240611222905.34695-1-kuniyu@amazon.com> (raw)
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().)
When we cannot define the total ordering, we return -1 for
the allowed order and otherwise 0 as undefined. [0]
[0]: https://lore.kernel.org/netdev/thzkgbuwuo3knevpipu4rzsh5qgmwhklihypdgziiruabvh46f@uwdkpcfxgloo/
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: Define locking order for U_RECVQ_LOCK_EMBRYO in
unix_collect_skb().
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 | 136 +++++++++++++++++++++++++++---------------
net/unix/diag.c | 47 ++++-----------
net/unix/garbage.c | 8 +--
4 files changed, 101 insertions(+), 104 deletions(-)
--
2.30.2
next reply other threads:[~2024-06-11 22:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 22:28 Kuniyuki Iwashima [this message]
2024-06-11 22:28 ` [PATCH v2 net-next 01/11] af_unix: Define locking order for unix_table_double_lock() Kuniyuki Iwashima
2024-06-11 23:15 ` Kent Overstreet
2024-06-11 22:28 ` [PATCH v2 net-next 02/11] af_unix: Define locking order for U_LOCK_SECOND in unix_state_double_lock() Kuniyuki Iwashima
2024-06-11 23:16 ` Kent Overstreet
2024-06-11 22:28 ` [PATCH v2 net-next 03/11] af_unix: Don't retry after unix_state_lock_nested() in unix_stream_connect() Kuniyuki Iwashima
2024-06-14 10:49 ` Paolo Abeni
2024-06-14 18:53 ` Kuniyuki Iwashima
2024-06-11 22:28 ` [PATCH v2 net-next 04/11] af_unix: Define locking order for U_LOCK_SECOND " Kuniyuki Iwashima
2024-06-11 22:28 ` [PATCH v2 net-next 05/11] af_unix: Don't acquire unix_state_lock() for sock_i_ino() Kuniyuki Iwashima
2024-06-11 22:29 ` [PATCH v2 net-next 06/11] af_unix: Remove U_LOCK_DIAG Kuniyuki Iwashima
2024-06-11 22:29 ` [PATCH v2 net-next 07/11] af_unix: Remove U_LOCK_GC_LISTENER Kuniyuki Iwashima
2024-06-11 22:29 ` [PATCH v2 net-next 08/11] af_unix: Define locking order for U_RECVQ_LOCK_EMBRYO in unix_collect_skb() Kuniyuki Iwashima
2024-06-11 23:17 ` Kent Overstreet
2024-06-11 23:23 ` Kuniyuki Iwashima
2024-06-14 11:04 ` Paolo Abeni
2024-06-14 18:55 ` Kuniyuki Iwashima
2024-06-11 22:29 ` [PATCH v2 net-next 09/11] af_unix: Set sk_peer_pid/sk_peer_cred locklessly for new socket Kuniyuki Iwashima
2024-06-11 22:29 ` [PATCH v2 net-next 10/11] af_unix: Remove put_pid()/put_cred() in copy_peercred() Kuniyuki Iwashima
2024-06-11 22:29 ` [PATCH v2 net-next 11/11] af_unix: Don't use spin_lock_nested() " Kuniyuki Iwashima
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240611222905.34695-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kent.overstreet@linux.dev \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).