From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Kuniyuki Iwashima <kuniyu@google.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
Kuniyuki Iwashima <kuniyu@google.com>,
Kuniyuki Iwashima <kuni1840@gmail.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH v1 net-next 1/7] af_unix: Don't hold unix_state_lock() in __unix_dgram_recvmsg().
Date: Sun, 06 Jul 2025 10:10:17 -0400 [thread overview]
Message-ID: <686a83c9444b3_3aa654294e@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <20250702223606.1054680-2-kuniyu@google.com>
Kuniyuki Iwashima wrote:
> When __skb_try_recv_datagram() returns NULL in __unix_dgram_recvmsg(),
> we hold unix_state_lock() unconditionally.
>
> This is because SOCK_SEQPACKET sk needs to return EOF in case its peer
> has been close()d concurrently.
>
> This behaviour totally depends on the timing of the peer's close() and
> reading sk->sk_shutdown, and taking the lock does not play a role.
>
> Let's drop the lock from __unix_dgram_recvmsg() and use READ_ONCE().
>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
next prev parent reply other threads:[~2025-07-06 14:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-02 22:35 [PATCH v1 net-next 0/7] af_unix: Introduce SO_INQ & SCM_INQ Kuniyuki Iwashima
2025-07-02 22:35 ` [PATCH v1 net-next 1/7] af_unix: Don't hold unix_state_lock() in __unix_dgram_recvmsg() Kuniyuki Iwashima
2025-07-06 14:10 ` Willem de Bruijn [this message]
2025-07-02 22:35 ` [PATCH v1 net-next 2/7] af_unix: Don't check SOCK_DEAD in unix_stream_read_skb() Kuniyuki Iwashima
2025-07-02 22:35 ` [PATCH v1 net-next 3/7] af_unix: Don't use skb_recv_datagram() " Kuniyuki Iwashima
2025-07-02 22:35 ` [PATCH v1 net-next 4/7] af_unix: Use cached value for SOCK_STREAM in unix_inq_len() Kuniyuki Iwashima
2025-07-06 13:53 ` Willem de Bruijn
2025-07-06 14:13 ` Willem de Bruijn
2025-07-02 22:35 ` [PATCH v1 net-next 5/7] af_unix: Cache state->msg in unix_stream_read_generic() Kuniyuki Iwashima
2025-07-02 22:35 ` [PATCH v1 net-next 6/7] af_unix: Introduce SO_INQ Kuniyuki Iwashima
2025-07-06 14:02 ` Willem de Bruijn
2025-07-06 19:21 ` Kuniyuki Iwashima
2025-07-02 22:35 ` [PATCH v1 net-next 7/7] selftest: af_unix: Add test for SO_INQ Kuniyuki Iwashima
2025-07-06 14:04 ` Willem de Bruijn
2025-07-09 1:30 ` [PATCH v1 net-next 0/7] af_unix: Introduce SO_INQ & SCM_INQ patchwork-bot+netdevbpf
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=686a83c9444b3_3aa654294e@willemb.c.googlers.com.notmuch \
--to=willemdebruijn.kernel@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=kuniyu@google.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).