ipv6: avoid taking locks at socket dismantle
authorEric Dumazet <edumazet@google.com>
Wed, 5 Dec 2012 09:18:10 +0000 (09:18 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 5 Dec 2012 21:01:28 +0000 (16:01 -0500)
commit0e1efe9d5e10921f1e2152b108e013605fca3c9f
treec254570a9058345ea2eb1f319cc5c88cfe8c65ee
parentcc86802805b5d714a5dc80fe4edecaf1368b09ed
ipv6: avoid taking locks at socket dismantle

ipv6_sock_mc_close() is called for ipv6 sockets at close time, and most
of them don't use multicast.

Add a test to avoid contention on a shared spinlock.

Same heuristic applies for ipv6_sock_ac_close(), to avoid contention
on a shared rwlock.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/anycast.c
net/ipv6/mcast.c