From: Eric Dumazet Date: Fri, 9 Feb 2024 15:31:00 +0000 (+0000) Subject: net: use synchronize_rcu_expedited in cleanup_net() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=78c3253f27e579f7f3a1f5c0cb8266693a7b4f41;p=users%2Fjedix%2Flinux-maple.git net: use synchronize_rcu_expedited in cleanup_net() cleanup_net() is calling synchronize_rcu() right before acquiring RTNL. synchronize_rcu() is much slower than synchronize_rcu_expedited(), and cleanup_net() is currently single threaded. In many workloads we want cleanup_net() to be fast, in order to free memory and various sysfs and procfs entries as fast as possible. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 233ec0cdd0111..f0540c5575157 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -622,7 +622,7 @@ static void cleanup_net(struct work_struct *work) * the rcu_barrier() below isn't sufficient alone. * Also the pre_exit() and exit() methods need this barrier. */ - synchronize_rcu(); + synchronize_rcu_expedited(); rtnl_lock(); list_for_each_entry_reverse(ops, &pernet_list, list) {