netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: Cosmin Ratiu <cratiu@nvidia.com>
Cc: "kuba@kernel.org" <kuba@kernel.org>,
	"edumazet@google.com" <edumazet@google.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"sdf@fomichev.me" <sdf@fomichev.me>
Subject: Re: [PATCH net-next 2/9] net: hold instance lock during NETDEV_REGISTER/UP/UNREGISTER
Date: Wed, 26 Mar 2025 15:02:52 -0700	[thread overview]
Message-ID: <Z-R5jEo4-WRZr86I@mini-arch> (raw)
In-Reply-To: <66a15c52d68a2317dfa65093ecd227b0ad4684cc.camel@nvidia.com>

On 03/26, Cosmin Ratiu wrote:
> On Wed, 2025-03-26 at 21:57 +0100, Cosmin Ratiu wrote:
> > 
> > Am I missing some locking annotation patch? A quick search in net-
> > next
> > turned out nothing.
> 
> Soon after sending the previous email, I found
> netdev_lockdep_set_classes and saw that it disables deadlock checking
> for the instance lock. With it in place, it works.
> I also saw your other email immediately after...
> 
> With that in place, things seem to work fine without further warnings
> for a few quick tests.
> 
> However, it seems that this approach is dangerous, there is the
> possibility of an actual deadlock with two concurrent
> netif_change_net_namespace when the RTNL is removed from that path.

Yeah, netdev_lockdep_set_classes is not pretty, but it should do until
we solve the locking for the layering devices. Which is another can
of worms I don't want to open in the current release. We want to be
in a somewhat consistent state before jumping to the rest (dropping
rtnl for ethtool, properly fixing notifiers, upper/lower locking).

For the netlink path, we are very unlikely to remove rtnl, so let's
deal with the ordering when and if we get there.

Thanks again for testing btw, lmk if you hit any other issues, I want
to unblock your (Saeed's) queue management changes.. I'll try to post
a v2 later today or tomorrow.

  reply	other threads:[~2025-03-26 22:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-25 21:30 [PATCH net-next 0/9] net: hold instance lock during NETDEV_UP/REGISTER/UNREGISTER Stanislav Fomichev
2025-03-25 21:30 ` [PATCH net-next 1/9] net: switch to netif_disable_lro in inetdev_init Stanislav Fomichev
2025-03-25 21:30 ` [PATCH net-next 2/9] net: hold instance lock during NETDEV_REGISTER/UP/UNREGISTER Stanislav Fomichev
2025-03-26 15:03   ` Cosmin Ratiu
2025-03-26 15:23     ` Stanislav Fomichev
2025-03-26 15:37       ` Cosmin Ratiu
2025-03-26 17:49         ` Stanislav Fomichev
2025-03-26 20:37           ` Stanislav Fomichev
2025-03-26 20:57           ` Cosmin Ratiu
2025-03-26 21:18             ` Cosmin Ratiu
2025-03-26 22:02               ` Stanislav Fomichev [this message]
2025-03-26 15:24     ` Cosmin Ratiu
2025-03-26 17:43       ` Stanislav Fomichev
2025-03-25 21:30 ` [PATCH net-next 3/9] net: use netif_disable_lro in ipv6_add_dev Stanislav Fomichev
2025-03-26  7:33   ` kernel test robot
2025-03-25 21:30 ` [PATCH net-next 4/9] net: dummy: request ops lock Stanislav Fomichev
2025-03-25 21:30 ` [PATCH net-next 5/9] net: release instance lock during NETDEV_UNREGISTER for bond/team Stanislav Fomichev
2025-03-25 21:30 ` [PATCH net-next 6/9] docs: net: document netdev notifier expectations Stanislav Fomichev
2025-03-25 21:30 ` [PATCH net-next 7/9] net: designate XSK pool pointers in queues as "ops protected" Stanislav Fomichev
2025-03-25 21:30 ` [PATCH net-next 8/9] netdev: add "ops compat locking" helpers Stanislav Fomichev
2025-03-25 21:30 ` [PATCH net-next 9/9] netdev: don't hold rtnl_lock over nl queue info get when possible 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=Z-R5jEo4-WRZr86I@mini-arch \
    --to=stfomichev@gmail.com \
    --cc=cratiu@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --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 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).