[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120402140645.6283.21190.stgit@srivatsabhat.in.ibm.com>
Date: Mon, 02 Apr 2012 19:36:45 +0530
From: "Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
To: lenb@...nel.org
Cc: venki@...gle.com, suresh.b.siddha@...el.com, bp@...64.org,
tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
x86@...nel.org, ben@...adent.org.uk, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org,
"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>,
deepthi@...ux.vnet.ibm.com
Subject: [PATCH] x86: Make mwait_usable() respect "idle=nomwait" kernel
parameter
mwait_usable() returns 1 even if the "idle=nomwait" kernel parameter is passed.
Fix it by adding a check for boot_option_idle_override == IDLE_NOMWAIT and
returning 0 if it is set.
Before applying the patch (dmesg snippet):
[ 0.000000] Command line: [...] idle=nomwait
[ 0.000000] Kernel command line: [...] idle=nomwait
[ 0.000000] RCU dyntick-idle grace-period acceleration is enabled.
[ 0.140606] using mwait in idle threads. <======= mwait being used
[ 4.303986] cpuidle: using governor ladder
[ 4.308232] cpuidle: using governor menu
After applying the patch:
[ 0.000000] Command line: [...] idle=nomwait
[ 0.000000] Kernel command line: [...] idle=nomwait
[ 0.000000] RCU dyntick-idle grace-period acceleration is enabled.
[ 4.264100] cpuidle: using governor ladder
[ 4.268342] cpuidle: using governor menu
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com>
---
arch/x86/kernel/process.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index a33afaa..945fbf0 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -621,6 +621,9 @@ int mwait_usable(const struct cpuinfo_x86 *c)
if (boot_option_idle_override == IDLE_FORCE_MWAIT)
return 1;
+ if (boot_option_idle_override == IDLE_NOMWAIT)
+ return 0;
+
if (c->cpuid_level < MWAIT_INFO)
return 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists