From patchwork Sun Aug 25 07:23:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eliezer Tamir X-Patchwork-Id: 269690 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 020ED2C00A2 for ; Sun, 25 Aug 2013 17:24:14 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756078Ab3HYHXu (ORCPT ); Sun, 25 Aug 2013 03:23:50 -0400 Received: from mga02.intel.com ([134.134.136.20]:9679 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754099Ab3HYHXt (ORCPT ); Sun, 25 Aug 2013 03:23:49 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 25 Aug 2013 00:23:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.89,950,1367996400"; d="scan'208";a="368072197" Received: from ladj378.jer.intel.com ([10.12.232.220]) by orsmga001.jf.intel.com with ESMTP; 25 Aug 2013 00:23:47 -0700 From: Eliezer Tamir Subject: [PATCH net] net: add cpu_relax to busy poll loop To: David Miller Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Eliezer Tamir Date: Sun, 25 Aug 2013 10:23:46 +0300 Message-ID: <20130825072346.31655.84970.stgit@ladj378.jer.intel.com> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- include/net/busy_poll.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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));