ipv4: speedup ipv6 tunnels dismantle
Implement exit_batch() method to dismantle more devices per round. (rtnl_lock() ... unregister_netdevice_many() ... rtnl_unlock()) Tested: $ cat add_del_unshare.sh for i in `seq 1 40` do (for j in `seq 1 100` ; do unshare -n /bin/true >/dev/null ; done) & done wait ; grep net_namespace /proc/slabinfo Before patch : $ time ./add_del_unshare.sh net_namespace 126 282 5504 1 2 : tunables 8 4 0 : slabdata 126 282 0 real 1m38.965s user 0m0.688s sys 0m37.017s After patch: $ time ./add_del_unshare.sh net_namespace 135 291 5504 1 2 : tunables 8 4 0 : slabdata 135 291 0 real 0m22.117s user 0m0.728s sys 0m35.328s Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
bb401caefe
commit
64bc17811b
@@ -634,15 +634,14 @@ static int __net_init ipip_init_net(struct net *net)
|
||||
return ip_tunnel_init_net(net, ipip_net_id, &ipip_link_ops, "tunl0");
|
||||
}
|
||||
|
||||
static void __net_exit ipip_exit_net(struct net *net)
|
||||
static void __net_exit ipip_exit_batch_net(struct list_head *list_net)
|
||||
{
|
||||
struct ip_tunnel_net *itn = net_generic(net, ipip_net_id);
|
||||
ip_tunnel_delete_net(itn, &ipip_link_ops);
|
||||
ip_tunnel_delete_nets(list_net, ipip_net_id, &ipip_link_ops);
|
||||
}
|
||||
|
||||
static struct pernet_operations ipip_net_ops = {
|
||||
.init = ipip_init_net,
|
||||
.exit = ipip_exit_net,
|
||||
.exit_batch = ipip_exit_batch_net,
|
||||
.id = &ipip_net_id,
|
||||
.size = sizeof(struct ip_tunnel_net),
|
||||
};
|
||||
|
Reference in New Issue
Block a user