All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: add cpu_relax to busy poll loop
@ 2013-08-25  7:23 Eliezer Tamir
  2013-08-28 21:46 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eliezer Tamir @ 2013-08-25  7:23 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel, netdev, Eliezer Tamir

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>
---

 include/net/busy_poll.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

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));


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: add cpu_relax to busy poll loop
  2013-08-25  7:23 [PATCH net] net: add cpu_relax to busy poll loop Eliezer Tamir
@ 2013-08-28 21:46 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-08-28 21:46 UTC (permalink / raw)
  To: eliezer.tamir; +Cc: linux-kernel, netdev, eliezer

From: Eliezer Tamir <eliezer.tamir@linux.intel.com>
Date: Sun, 25 Aug 2013 10:23:46 +0300

> 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>

Applied, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-28 21:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-25  7:23 [PATCH net] net: add cpu_relax to busy poll loop Eliezer Tamir
2013-08-28 21:46 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.