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

can: gw: switch cangw_pernet_exit() to batch mode

cleanup_net() is competing with other rtnl users.

Avoiding to acquire rtnl for each netns before calling
cgw_remove_all_jobs() gives chance for cleanup_net()
to progress much faster, holding rtnl a bit longer.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
Acked-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 696e595f
...@@ -1239,16 +1239,19 @@ static int __net_init cangw_pernet_init(struct net *net) ...@@ -1239,16 +1239,19 @@ static int __net_init cangw_pernet_init(struct net *net)
return 0; return 0;
} }
static void __net_exit cangw_pernet_exit(struct net *net) static void __net_exit cangw_pernet_exit_batch(struct list_head *net_list)
{ {
struct net *net;
rtnl_lock(); rtnl_lock();
list_for_each_entry(net, net_list, exit_list)
cgw_remove_all_jobs(net); cgw_remove_all_jobs(net);
rtnl_unlock(); rtnl_unlock();
} }
static struct pernet_operations cangw_pernet_ops = { static struct pernet_operations cangw_pernet_ops = {
.init = cangw_pernet_init, .init = cangw_pernet_init,
.exit = cangw_pernet_exit, .exit_batch = cangw_pernet_exit_batch,
}; };
static __init int cgw_module_init(void) static __init int cgw_module_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