From: Eric Dumazet Date: Fri, 24 Aug 2012 05:40:47 +0000 (+0000) Subject: ipv4: take rt_uncached_lock only if needed X-Git-Tag: v3.6-rc5~20^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=78df76a065ae3b5dbcb9a29912adc02f697de498;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git 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 Signed-off-by: David S. Miller --- diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 8c8c748..24fd4c5 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -1263,7 +1263,7 @@ static void ipv4_dst_destroy(struct dst_entry *dst) { struct rtable *rt = (struct rtable *) dst; - if (dst->flags & DST_NOCACHE) { + if (!list_empty(&rt->rt_uncached)) { spin_lock_bh(&rt_uncached_lock); list_del(&rt->rt_uncached); spin_unlock_bh(&rt_uncached_lock);