From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: lenb@kernel.org
Cc: venki@google.com, suresh.b.siddha@intel.com, bp@amd64.org,
tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
x86@kernel.org, ben@decadent.org.uk,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
"Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>,
deepthi@linux.vnet.ibm.com
Subject: [PATCH] x86: Make mwait_usable() respect "idle=nomwait" kernel parameter
Date: Mon, 02 Apr 2012 19:36:45 +0530 [thread overview]
Message-ID: <20120402140645.6283.21190.stgit@srivatsabhat.in.ibm.com> (raw)
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;
next reply other threads:[~2012-04-02 14:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-02 14:06 Srivatsa S. Bhat [this message]
2012-04-03 11:49 ` Srivatsa S. Bhat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120402140645.6283.21190.stgit@srivatsabhat.in.ibm.com \
--to=srivatsa.bhat@linux.vnet.ibm.com \
--cc=ben@decadent.org.uk \
--cc=bp@amd64.org \
--cc=deepthi@linux.vnet.ibm.com \
--cc=hpa@zytor.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
--cc=venki@google.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®