[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9f222ade-715c-4010-a5f8-7058a0e0f1ba@linux.dev>
Date: Tue, 14 Jan 2025 15:09:16 -0800
From: Jesse Brandeburg <jesse.brandeburg@...ux.dev>
To: Eric Dumazet <edumazet@...gle.com>, "David S . Miller"
<davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, Simon Horman <horms@...nel.org>,
eric.dumazet@...il.com
Subject: Re: [PATCH v3 net-next 5/5] net: reduce RTNL hold duration in
unregister_netdevice_many_notify() (part 2)
On 1/14/25 12:55 PM, Eric Dumazet wrote:
> One synchronize_net() call is currently done while holding RTNL.
>
> This is source of RTNL contention in workloads adding and deleting
> many network namespaces per second, because synchronize_rcu()
> and synchronize_rcu_expedited() can use 60+ ms in some cases.
>
> For cleanup_net() use, temporarily release RTNL
> while calling the last synchronize_net().
>
> This should be safe, because devices are no longer visible
> to other threads after unlist_netdevice() call
> and setting dev->reg_state to NETREG_UNREGISTERING.
>
> In any case, the new netdev_lock() / netdev_unlock()
> infrastructure that we are adding should allow
> to fix potential issues, with a combination
> of a per-device mutex and dev->reg_state awareness.
>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
Reviewed-by: Jesse Brandeburg <jbrandeburg@...udflare.com>
Powered by blists - more mailing lists