net: make net->dev_unreg_count atomic

Having to acquire rtnl from netdev_run_todo() for every dismantled
device is not desirable when/if rtnl is under stress.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Eric Dumazet
2022-02-09 18:59:32 -08:00
committed by David S. Miller
parent ca2d5f1ff0
commit ede6c39c4f
3 changed files with 6 additions and 9 deletions

View File

@@ -63,7 +63,7 @@ struct net {
*/
spinlock_t rules_mod_lock;
unsigned int dev_unreg_count;
atomic_t dev_unreg_count;
unsigned int dev_base_seq; /* protected by rtnl_mutex */
int ifindex;