From: Eliezer Tamir Date: Sun, 25 Aug 2013 07:23:46 +0000 (+0300) Subject: net: add cpu_relax to busy poll loop X-Git-Tag: v3.11~4^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3046e2f5b79a86044ac0a29c69610d6ac6a4b882;p=platform%2Fkernel%2Flinux-exynos.git net: add cpu_relax to busy poll loop Add a cpu_relaxt to sk_busy_loop. Julie Cummings reported performance issues when hyperthreading is on. Arjan van de Ven observed that we should have a cpu_relax() in the busy poll loop. Reported-by: Julie Cummings Signed-off-by: Eliezer Tamir Signed-off-by: David S. Miller --- diff --git a/include/net/busy_poll.h b/include/net/busy_poll.h index 8a358a2..829627d 100644 --- a/include/net/busy_poll.h +++ b/include/net/busy_poll.h @@ -123,6 +123,7 @@ static inline bool sk_busy_loop(struct sock *sk, int nonblock) /* local bh are disabled so it is ok to use _BH */ NET_ADD_STATS_BH(sock_net(sk), LINUX_MIB_BUSYPOLLRXPACKETS, rc); + cpu_relax(); } while (!nonblock && skb_queue_empty(&sk->sk_receive_queue) && !need_resched() && !busy_loop_timeout(end_time));