[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220325094952.10c46350@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Fri, 25 Mar 2022 09:49:52 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Johannes Berg <johannes@...solutions.net>
Cc: William McVicker <willmcvicker@...gle.com>,
linux-wireless@...r.kernel.org,
Marek Szyprowski <m.szyprowski@...sung.com>,
Kalle Valo <kvalo@...eaurora.org>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
Amitkumar Karwar <amitkarwar@...il.com>,
Ganapathi Bhat <ganapathi.bhat@....com>,
Xinming Hu <huxinming820@...il.com>, kernel-team@...roid.com,
Paolo Abeni <pabeni@...hat.com>
Subject: Re: [BUG] deadlock in nl80211_vendor_cmd
On Fri, 25 Mar 2022 13:04:23 +0100 Johannes Berg wrote:
> So we can avoid the potential deadlock in cfg80211 in a few ways:
>
> 1) export rtnl_lock_unregistering_all() or maybe a variant after
> refactoring the two versions, to allow cfg80211 to use it, that way
> netdev_run_todo() can never have a non-empty todo list
>
> 2) export __rtnl_unlock() so cfg80211 can avoid running
> netdev_run_todo() in the unlock, personally I like this less because
> it might encourage random drivers to use it
>
> 3) completely rework cfg80211's locking, adding a separate mutex for
> the wiphy list so we don't need to acquire the RTNL at all here
> (unless the ops need it, but there's no issue if we don't drop it),
> something like https://p.sipsolutions.net/27d08e1f5881a793.txt
>
>
> I think I'm happy with 3) now (even if it took a couple of hours), so I
> think we can go with it, just need to go through all the possibilities.
I like 3) as well. FWIW a few places (e.g. mlx5, devlink, I think I've
seen more) had been converting to xarray for managing the "registered"
objects. It may be worth looking into if you're re-doing things, anyway.
Powered by blists - more mailing lists