From: Andrea Parri <parri.andrea@gmail.com>
To: Kuniyuki Iwashima <kuniyu@google.com>
Cc: Andrea Parri <parri.andrea@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] rtnetlink: comment the RCU and SRCU waits in unregister paths
Date: Tue, 13 Oct 2026 12:52:58 +0200 [thread overview]
Message-ID: <20261013105301.9037-1-parri.andrea@gmail.com> (raw)
In-Reply-To: <CAAVpQUAd4QzUDK1wZYpuHJbMSg+PwAGCcaTzayR40DTNkXdwQA@mail.gmail.com>
On Mon, Oct 12, 2026 at 06:48:22PM -0700, Kuniyuki Iwashima wrote:
> > + /* Wait for rtnl_get_link() callers under RCU that may still
> > + * dereference tab.
> > + */
> > synchronize_net();
>
> More specifically, this only applies to callers before try_module_get().
Right, the later lookup in rtnetlink_rcv_msg() runs under RTNL. I'll
name rtnetlink_rcv_msg() and try_module_get() in v2.
> > + /* Wait for rtnl_link_ops_get() callers to call rtnl_link_ops_put(). */
> > synchronize_srcu(&ops->srcu);
>
> I think we don't need comment for srcu as the relation is
> clear via the argument.
Agreed, I'll drop both srcu comments.
> > + /* Wait for RCU walkers of rtnl_af_ops, including rtnl_af_lookup()
> > + * readers that found ops but have not yet taken ops->srcu.
> > + */
>
> this can be simply /* see rtnl_link_unregister() */ instead of duplicating
> comments.
The two waits cover different readers, though. Besides
rtnl_af_lookup(), the synchronize_rcu() in rtnl_af_unregister() also
waits for the RCU walkers of rtnl_af_ops that invoke callbacks without
ops->srcu: rtnl_link_get_af_size(), rtnl_fill_link_af() and the
IFLA_STATS_AF_SPEC paths. link_ops has no analogous RCU-only list
walkers, so a pointer there would miss them. I'd prefer to keep a
local comment, reworded in v2 to mention those walkers.
Thanks,
Andrea
prev parent reply other threads:[~2026-10-13 10:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 12:44 [PATCH net-next] rtnetlink: comment the RCU and SRCU waits in unregister paths Andrea Parri
2026-10-13 1:48 ` Kuniyuki Iwashima
2026-10-13 10:52 ` Andrea Parri [this message]
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=20261013105301.9037-1-parri.andrea@gmail.com \
--to=parri.andrea@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--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