Commit 78df76a0 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a0dfb263
...@@ -1263,7 +1263,7 @@ static void ipv4_dst_destroy(struct dst_entry *dst) ...@@ -1263,7 +1263,7 @@ static void ipv4_dst_destroy(struct dst_entry *dst)
{ {
struct rtable *rt = (struct rtable *) dst; struct rtable *rt = (struct rtable *) dst;
if (dst->flags & DST_NOCACHE) { if (!list_empty(&rt->rt_uncached)) {
spin_lock_bh(&rt_uncached_lock); spin_lock_bh(&rt_uncached_lock);
list_del(&rt->rt_uncached); list_del(&rt->rt_uncached);
spin_unlock_bh(&rt_uncached_lock); spin_unlock_bh(&rt_uncached_lock);
......
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