ip6tnl: Optimize multiple unregistration
Subsystems (3)
PATCH 1/1 ip6tnl: Optimize multiple unregistration
Speedup module unloading by factorizing synchronize_rcu() calls
Signed-off-by Eric Dumazet <[email protected]>
--- net/ipv6/ip6_tunnel.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-)
net/ipv6/ip6_tunnel.c +8 -3
@@ -1393,14 +1393,19 @@ static void ip6_tnl_destroy_tunnels(struct ip6_tnl_net *ip6n) {int h;struct ip6_tnl *t; +LIST_HEAD (list);for (h =0 ; h <HASH_SIZE ; h++) { -while ((t = ip6n->tnls_r_l[h]) !=NULL ) -unregister_netdevice (t->dev); + t = ip6n->tnls_r_l[h]; +while (t !=NULL ) { +unregister_netdevice_queue (t->dev, &list); + t = t->next; + } } t = ip6n->tnls_wc[0 ]; -unregister_netdevice (t->dev); +unregister_netdevice_queue (t->dev, &list); +unregister_netdevice_many (&list); }static int ip6_tnl_init_net (struct net *net)
From: Eric Dumazet <[email protected]>
Date: Wed, 28 Oct 2009 16:16:51 +0100
Quoted 3 lines
Speedup module unloading by factorizing
synchronize_rcu()callsSigned-off-by Eric Dumazet <[email protected]>
Applied.