From: Jakub Kicinski <kuba@kernel.org>
To: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: <andrew+netdev@lunn.ch>, <davem@davemloft.net>,
<edumazet@google.com>, <horms@kernel.org>,
<netdev@vger.kernel.org>, <pabeni@redhat.com>, <sdf@fomichev.me>
Subject: Re: [PATCH net-next] net: let lockdep compare instance locks
Date: Thu, 15 May 2025 19:36:09 -0700 [thread overview]
Message-ID: <20250515193609.3da84ac3@kernel.org> (raw)
In-Reply-To: <20250516015114.40011-1-kuniyu@amazon.com>
On Thu, 15 May 2025 18:49:07 -0700 Kuniyuki Iwashima wrote:
> > +#ifdef CONFIG_DEBUG_NET_SMALL_RTNL
> > + /* It's okay to use per-netns rtnl_lock if devices share netns */
> > + if (net_eq(dev_net(dev_a), dev_net(dev_b)) &&
> > + lockdep_rtnl_net_is_held(dev_net(dev_a)))
>
> Do we need
>
> !from_cleanup_net()
>
> before lockdep_rtnl_net_is_held() ?
>
> __rtnl_net_lock() is not held in ops_exit_rtnl_list() and
> default_device_exit_batch() when calling unregister_netdevice_many().
Or do we need
if (from_cleanup_net())
return -1;
?
Is the thinking that once the big rtnl lock disappears in cleanup_net
the devices are safe to destroy without any locking because there can't
be any live users trying to access them?
next prev parent reply other threads:[~2025-05-16 2:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-16 1:24 [PATCH net-next] net: let lockdep compare instance locks Jakub Kicinski
2025-05-16 1:49 ` Kuniyuki Iwashima
2025-05-16 2:36 ` Jakub Kicinski [this message]
2025-05-16 2:59 ` Kuniyuki Iwashima
2025-05-16 15:22 ` Jakub Kicinski
2025-05-16 17:14 ` Jakub Kicinski
2025-05-16 17:50 ` Kuniyuki Iwashima
2025-05-16 17:50 ` Stanislav Fomichev
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=20250515193609.3da84ac3@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuniyu@amazon.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.