Message ID | 20220118114340.3322252-1-eric.dumazet@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 2836615aa22de55b8fca5e32fe1b27a67cda625e |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] netns: add schedule point in ops_exit_list() | expand |
Hello: This patch was applied to netdev/net.git (master) by David S. Miller <davem@davemloft.net>: On Tue, 18 Jan 2022 03:43:40 -0800 you wrote: > From: Eric Dumazet <edumazet@google.com> > > When under stress, cleanup_net() can have to dismantle > netns in big numbers. ops_exit_list() currently calls > many helpers [1] that have no schedule point, and we can > end up with soft lockups, particularly on hosts > with many cpus. > > [...] Here is the summary with links: - [net] netns: add schedule point in ops_exit_list() https://git.kernel.org/netdev/net/c/2836615aa22d You are awesome, thank you!
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 9b7171c40434985b869c1477975fc75447d78c3b..a5b5bb99c64462dac2513f7b3e28cb0763844c21 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -164,8 +164,10 @@ static void ops_exit_list(const struct pernet_operations *ops, { struct net *net; if (ops->exit) { - list_for_each_entry(net, net_exit_list, exit_list) + list_for_each_entry(net, net_exit_list, exit_list) { ops->exit(net); + cond_resched(); + } } if (ops->exit_batch) ops->exit_batch(net_exit_list);