Commit 384353364373c7c9f8134a847a35e27642cb6dae

Authored by Ingo Molnar
Committed by Greg Kroah-Hartman
1 parent b2e4b1cc4a

x86: remove mwait capability C-state check

back-ported from upstream commit a738d897b7b03b83488ae74a9bc03d26a2875dc6 by Vegard Nossum

Vegard Nossum reports:

| powertop shows between 200-400 wakeups/second with the description
| "<kernel IPI>: Rescheduling interrupts" when all processors have load (e.g.
| I need to run two busy-loops on my 2-CPU system for this to show up).
|
| The bisect resulted in this commit:
|
| commit 0c07ee38c9d4eb081758f5ad14bbffa7197e1aec
| Date:   Wed Jan 30 13:33:16 2008 +0100
|
|     x86: use the correct cpuid method to detect MWAIT support for C states

remove the functional effects of this patch and make mwait unconditional.

A future patch will turn off mwait on specific CPUs where that causes
power to be wasted.

Bisected-by: Vegard Nossum <vegard.nossum@gmail.com>
Tested-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 2 changed files with 2 additions and 19 deletions Side-by-side Diff

arch/x86/kernel/process_32.c
... ... @@ -259,14 +259,6 @@
259 259 mwait_idle_with_hints(0, 0);
260 260 }
261 261  
262   -static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c)
263   -{
264   - if (force_mwait)
265   - return 1;
266   - /* Any C1 states supported? */
267   - return c->cpuid_level >= 5 && ((cpuid_edx(5) >> 4) & 0xf) > 0;
268   -}
269   -
270 262 void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
271 263 {
272 264 static int selected;
... ... @@ -279,7 +271,7 @@
279 271 " performance may degrade.\n");
280 272 }
281 273 #endif
282   - if (cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)) {
  274 + if (cpu_has(c, X86_FEATURE_MWAIT)) {
283 275 /*
284 276 * Skip, if setup has overridden idle.
285 277 * One CPU supports mwait => All CPUs supports mwait
arch/x86/kernel/process_64.c
... ... @@ -254,15 +254,6 @@
254 254 }
255 255 }
256 256  
257   -
258   -static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c)
259   -{
260   - if (force_mwait)
261   - return 1;
262   - /* Any C1 states supported? */
263   - return c->cpuid_level >= 5 && ((cpuid_edx(5) >> 4) & 0xf) > 0;
264   -}
265   -
266 257 void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
267 258 {
268 259 static int selected;
... ... @@ -275,7 +266,7 @@
275 266 " performance may degrade.\n");
276 267 }
277 268 #endif
278   - if (cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)) {
  269 + if (cpu_has(c, X86_FEATURE_MWAIT)) {
279 270 /*
280 271 * Skip, if setup has overridden idle.
281 272 * One CPU supports mwait => All CPUs supports mwait