diff options
author | Eric Dumazet <edumazet@google.com> | 2012-08-24 01:40:47 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-24 11:47:48 -0400 |
commit | 78df76a065ae3b5dbcb9a29912adc02f697de498 (patch) | |
tree | 5b9ab36790a2e0101a15d70bdf41b066ce0e55aa /net/ipv4/route.c | |
parent | a0dfb2634e5671770f598cda08002d8cda66ac77 (diff) |
ipv4: take rt_uncached_lock only if needed
Multicast traffic allocates dst with DST_NOCACHE, but dst is
not inserted into rt_uncached_list.
This slowdown multicast workloads on SMP because rt_uncached_lock is
contended.
Change the test before taking the lock to actually check the dst
was inserted into rt_uncached_list.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 8c8c748ebb28..24fd4c596643 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1263,7 +1263,7 @@ static void ipv4_dst_destroy(struct dst_entry *dst) | |||
1263 | { | 1263 | { |
1264 | struct rtable *rt = (struct rtable *) dst; | 1264 | struct rtable *rt = (struct rtable *) dst; |
1265 | 1265 | ||
1266 | if (dst->flags & DST_NOCACHE) { | 1266 | if (!list_empty(&rt->rt_uncached)) { |
1267 | spin_lock_bh(&rt_uncached_lock); | 1267 | spin_lock_bh(&rt_uncached_lock); |
1268 | list_del(&rt->rt_uncached); | 1268 | list_del(&rt->rt_uncached); |
1269 | spin_unlock_bh(&rt_uncached_lock); | 1269 | spin_unlock_bh(&rt_uncached_lock); |