From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, eric.dumazet@gmail.com,
syzbot+50603c05bbdf4dfdaffa@syzkaller.appspotmail.com,
Kuniyuki Iwashima <kuniyu@google.com>
Subject: Re: [PATCH net] net: lockless sock_i_ino()
Date: Wed, 3 Sep 2025 09:41:31 +0200 [thread overview]
Message-ID: <20250903074131.BclfkWQE@linutronix.de> (raw)
In-Reply-To: <20250902183603.740428-1-edumazet@google.com>
On 2025-09-02 18:36:03 [+0000], Eric Dumazet wrote:
> Followup of commit c51da3f7a161 ("net: remove sock_i_uid()")
>
> A recent syzbot report was the trigger for this change.
>
> Over the years, we had many problems caused by the
> read_lock[_bh](&sk->sk_callback_lock) in sock_i_uid().
>
> We could fix smc_diag_dump_proto() or make a more radical move:
>
> Instead of waiting for new syzbot reports, cache the socket
> inode number in sk->sk_ino, so that we no longer
> need to acquire sk->sk_callback_lock in sock_i_ino().
>
> This makes socket dumps faster (one less cache line miss,
> and two atomic ops avoided).
>
> Prior art:
>
> commit 25a9c8a4431c ("netlink: Add __sock_i_ino() for __netlink_diag_dump().")
> commit 4f9bf2a2f5aa ("tcp: Don't acquire inet_listen_hashbucket::lock with disabled BH.")
> commit efc3dbc37412 ("rds: Make rds_sock_lock BH rather than IRQ safe.")
>
> Fixes: d2d6422f8bd1 ("x86: Allow to enable PREEMPT_RT.")
> Reported-by: syzbot+50603c05bbdf4dfdaffa@syzkaller.appspotmail.com
> Closes: https://lore.kernel.org/netdev/68b73804.050a0220.3db4df.01d8.GAE@google.com/T/#u
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Cc: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Sebastian
next prev parent reply other threads:[~2025-09-03 7:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 18:36 [PATCH net] net: lockless sock_i_ino() Eric Dumazet
2025-09-03 5:26 ` Kuniyuki Iwashima
2025-09-03 7:41 ` Sebastian Andrzej Siewior [this message]
2025-09-03 23:30 ` patchwork-bot+netdevbpf
2025-09-15 18:16 ` Andrei Vagin
2025-09-15 18:51 ` Eric Dumazet
2025-09-15 19:01 ` Andrei Vagin
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=20250903074131.BclfkWQE@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=syzbot+50603c05bbdf4dfdaffa@syzkaller.appspotmail.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).