Skip to content

Commit

Permalink
ipv6: change fib6_rules_net_exit() to batch mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and Jakub Kicinski committed Feb 9, 2022
1 parent 1c69576 commit ea3e916
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions net/ipv6/fib6_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,16 +493,21 @@ static int __net_init fib6_rules_net_init(struct net *net)
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)
Expand Down

0 comments on commit ea3e916

Please sign in to comment.