net: add cpu_relax to busy poll loop
Subsystems (2)
PATCH 1/1 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 <[email protected]>
Signed-off-by Eliezer Tamir <[email protected]>
---
include/net/busy_poll.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
include/net/busy_poll.h +1 -0
@@ -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));
From: Eliezer Tamir <[email protected]>
Date: Sun, 25 Aug 2013 10:23:46 +0300
Quoted 8 lines
Add a
cpu_relaxttosk_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 <[email protected]>Signed-off-by Eliezer Tamir <[email protected]>
Applied, thank you.