From patchwork Wed Mar 6 11:18:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 2224711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 6C5A03FCF6 for ; Wed, 6 Mar 2013 11:26:31 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UDCQs-0000w6-Vj; Wed, 06 Mar 2013 11:22:51 +0000 Received: from www.linutronix.de ([62.245.132.108] helo=Galois.linutronix.de) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UDCOo-00080y-Ol for linux-arm-kernel@lists.infradead.org; Wed, 06 Mar 2013 11:20:50 +0000 Received: from localhost ([127.0.0.1] helo=localhost6.localdomain6) by Galois.linutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1UDCMo-0006Mu-9j; Wed, 06 Mar 2013 12:18:38 +0100 Message-Id: <20130306111537.702278273@linutronix.de> User-Agent: quilt/0.48-1 Date: Wed, 06 Mar 2013 11:18:37 -0000 From: Thomas Gleixner To: LKML Subject: [patch 7/7] x86: Use tick broadcast expired check References: <20130306111351.883117670@linutronix.de> Content-Disposition: inline; filename=x86-use-broadcast-expired-check.patch X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1, SHORTCIRCUIT=-0.0001 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130306_062043_013956_B0311CC3 X-CRM114-Status: UNSURE ( 7.56 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -4.8 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [62.245.132.108 listed in list.dnswl.org] -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Lorenzo Pieralisi , x86@kernel.org, Santosh Shilimkar , Jason Liu , John Stultz , LAK , Arjan van de Veen X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Avoid going back into deep idle if the tick broadcast IPI is about to fire. Signed-off-by: Thomas Gleixner Cc: x86@kernel.org --- arch/x86/kernel/process.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) Index: tip/arch/x86/kernel/process.c =================================================================== --- tip.orig/arch/x86/kernel/process.c +++ tip/arch/x86/kernel/process.c @@ -336,6 +336,18 @@ void cpu_idle(void) local_touch_nmi(); local_irq_disable(); + /* + * We detected in the wakeup path that the + * tick broadcast device expired for us, but + * we raced with the other CPU and came back + * here before it was able to fire the IPI. + * No point in going idle. + */ + if (tick_check_broadcast_expired()) { + local_irq_enable(); + continue; + } + enter_idle(); /* Don't trace irqs off for idle */