Commit ea3e9166 authored by Eric Dumazet's avatar Eric Dumazet Committed by Jakub Kicinski

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: default avatarEric Dumazet <edumazet@google.com>
Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1c695764
...@@ -493,16 +493,21 @@ static int __net_init fib6_rules_net_init(struct net *net) ...@@ -493,16 +493,21 @@ static int __net_init fib6_rules_net_init(struct net *net)
goto out; 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(); 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(); rtnl_unlock();
} }
static struct pernet_operations fib6_rules_net_ops = { static struct pernet_operations fib6_rules_net_ops = {
.init = fib6_rules_net_init, .init = fib6_rules_net_init,
.exit = fib6_rules_net_exit, .exit_batch = fib6_rules_net_exit_batch,
}; };
int __init fib6_rules_init(void) int __init fib6_rules_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment