summaryrefslogtreecommitdiff
path: root/net/ipv6/fib6_rules.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2022-02-08 07:50:33 +0300
committerJakub Kicinski <kuba@kernel.org>2022-02-09 07:41:34 +0300
commitea3e91666ddd9f141632157ee601325d1d207061 (patch)
tree09e3fa37ecbeffced99c5a6946a656d540cd8d77 /net/ipv6/fib6_rules.c
parent1c69576461435521b020cf0e6475b7524c1394dd (diff)
downloadlinux-ea3e91666ddd9f141632157ee601325d1d207061.tar.xz
ipv6: change fib6_rules_net_exit() to batch mode
cleanup_net() is competing with other rtnl users. fib6_rules_net_exit() seems a good candidate for exit_batch(), as this gives chance for cleanup_net() to progress much faster, holding rtnl a bit longer. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: David Ahern <dsahern@kernel.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv6/fib6_rules.c')
-rw-r--r--net/ipv6/fib6_rules.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index e2a7b0059669..7c2003833010 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -493,16 +493,21 @@ out_fib6_rules_ops:
goto out;
}
-static void __net_exit fib6_rules_net_exit(struct net *net)
+static void __net_exit fib6_rules_net_exit_batch(struct list_head *net_list)
{
+ struct net *net;
+
rtnl_lock();
- fib_rules_unregister(net->ipv6.fib6_rules_ops);
+ list_for_each_entry(net, net_list, exit_list) {
+ fib_rules_unregister(net->ipv6.fib6_rules_ops);
+ cond_resched();
+ }
rtnl_unlock();
}
static struct pernet_operations fib6_rules_net_ops = {
.init = fib6_rules_net_init,
- .exit = fib6_rules_net_exit,
+ .exit_batch = fib6_rules_net_exit_batch,
};
int __init fib6_rules_init(void)