summaryrefslogtreecommitdiff
path: root/include/net/busy_poll.h
diff options
context:
space:
mode:
authorEliezer Tamir <eliezer.tamir@linux.intel.com>2013-08-25 10:23:46 +0300
committerDavid S. Miller <davem@davemloft.net>2013-08-28 17:45:48 -0400
commit3046e2f5b79a86044ac0a29c69610d6ac6a4b882 (patch)
tree92148960b1400fb5e5c30192530103f5cddd82d0 /include/net/busy_poll.h
parent64c3b252e9fc8256ef7b1b99ba60492163cd06e8 (diff)
downloadlinux-rpi-3046e2f5b79a86044ac0a29c69610d6ac6a4b882.tar.gz
linux-rpi-3046e2f5b79a86044ac0a29c69610d6ac6a4b882.tar.bz2
linux-rpi-3046e2f5b79a86044ac0a29c69610d6ac6a4b882.zip
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 <julie.a.cummings@intel.com> Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/busy_poll.h')
-rw-r--r--include/net/busy_poll.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/busy_poll.h b/include/net/busy_poll.h
index 8a358a2c97e6..829627d7b846 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));