linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: Make mwait_usable() respect "idle=nomwait" kernel parameter
@ 2012-04-02 14:06 Srivatsa S. Bhat
  2012-04-03 11:49 ` Srivatsa S. Bhat
  0 siblings, 1 reply; 2+ messages in thread
From: Srivatsa S. Bhat @ 2012-04-02 14:06 UTC (permalink / raw)
  To: lenb
  Cc: venki, suresh.b.siddha, bp, tglx, mingo, hpa, x86, ben,
	linux-kernel, linux-pm, Srivatsa S. Bhat, deepthi

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@linux.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;
 


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

end of thread, other threads:[~2012-04-03 11:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-02 14:06 [PATCH] x86: Make mwait_usable() respect "idle=nomwait" kernel parameter Srivatsa S. Bhat
2012-04-03 11:49 ` Srivatsa S. Bhat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).