[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z-R5jEo4-WRZr86I@mini-arch>
Date: Wed, 26 Mar 2025 15:02:52 -0700
From: Stanislav Fomichev <stfomichev@...il.com>
To: Cosmin Ratiu <cratiu@...dia.com>
Cc: "kuba@...nel.org" <kuba@...nel.org>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"sdf@...ichev.me" <sdf@...ichev.me>
Subject: Re: [PATCH net-next 2/9] net: hold instance lock during
NETDEV_REGISTER/UP/UNREGISTER
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.
Powered by blists - more mailing lists