Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932429Ab2BXWeK (ORCPT ); Fri, 24 Feb 2012 17:34:10 -0500 Received: from mail-pz0-f46.google.com ([209.85.210.46]:45740 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932392Ab2BXWeB (ORCPT ); Fri, 24 Feb 2012 17:34:01 -0500 Authentication-Results: mr.google.com; spf=pass (google.com: domain of venki@google.com designates 10.68.129.73 as permitted sender) smtp.mail=venki@google.com; dkim=pass header.i=venki@google.com MIME-Version: 1.0 From: Venkatesh Pallipadi To: Peter Zijlstra , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: Suresh Siddha , Aaron Durbin , Paul Turner , Yong Zhang , Andi Kleen , linux-kernel@vger.kernel.org, Venkatesh Pallipadi Subject: [PATCH 3/4] x86: Extend IPIless wake to C1_mwait and poll_idle Date: Fri, 24 Feb 2012 14:33:19 -0800 Message-Id: <1330122800-834-4-git-send-email-venki@google.com> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1330122800-834-1-git-send-email-venki@google.com> References: <1330122800-834-1-git-send-email-venki@google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2212 Lines: 73 poll_idle(), mwait_idle() [which is used for C1 mwait] and any other polling based idle loops can also use the IPIless wakeup logic added with mwait_idle_with_hints() in the earlier patch. Signed-off-by: Venkatesh Pallipadi --- arch/x86/kernel/process.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 99a8109..43bb0a5 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -22,6 +22,7 @@ #include #include #include +#include struct kmem_cache *task_xstate_cachep; EXPORT_SYMBOL_GPL(task_xstate_cachep); @@ -445,7 +446,8 @@ EXPORT_SYMBOL_GPL(cpu_idle_wait); /* Default MONITOR/MWAIT with no hints, used for default C1 state */ static void mwait_idle(void) { - if (!need_resched()) { + enter_ipiless_idle(); + if (!is_ipiless_wakeup_pending()) { trace_power_start(POWER_CSTATE, 1, smp_processor_id()); trace_cpu_idle(1, smp_processor_id()); if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR)) @@ -453,7 +455,7 @@ static void mwait_idle(void) __monitor((void *)¤t_thread_info()->flags, 0, 0); smp_mb(); - if (!need_resched()) + if (!is_ipiless_wakeup_pending()) __sti_mwait(0, 0); else local_irq_enable(); @@ -461,6 +463,7 @@ static void mwait_idle(void) trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id()); } else local_irq_enable(); + exit_ipiless_idle(); } /* @@ -470,13 +473,15 @@ static void mwait_idle(void) */ static void poll_idle(void) { + enter_ipiless_idle(); trace_power_start(POWER_CSTATE, 0, smp_processor_id()); trace_cpu_idle(0, smp_processor_id()); local_irq_enable(); - while (!need_resched()) + while (!is_ipiless_wakeup_pending()) cpu_relax(); trace_power_end(smp_processor_id()); trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id()); + exit_ipiless_idle(); } /* -- 1.7.7.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/