diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2008-06-09 16:59:53 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-10 15:52:01 +0200 |
commit | 6ddd2a27948f0bd02a2ad001e8a6816898eba0dc (patch) | |
tree | 4a9a8b4d1186bb5a03df6c26f23d4a4a8ba6f7bd /arch/x86/kernel/process.c | |
parent | 9e26d84273541a8c6c2efb705457ca8e6245fb73 (diff) | |
download | blackbird-op-linux-6ddd2a27948f0bd02a2ad001e8a6816898eba0dc.tar.gz blackbird-op-linux-6ddd2a27948f0bd02a2ad001e8a6816898eba0dc.zip |
x86: simplify idle selection
default_idle is selected in cpu_idle(), when no other idle routine is
selected. Select it in select_idle_routine() when mwait is not
selected.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r-- | arch/x86/kernel/process.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index ba370dc8685b..b3078f4ce25b 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -139,27 +139,23 @@ static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c) void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c) { - static int selected; - - if (selected) - return; #ifdef CONFIG_X86_SMP if (pm_idle == poll_idle && smp_num_siblings > 1) { printk(KERN_WARNING "WARNING: polling idle and HT enabled," " performance may degrade.\n"); } #endif + if (pm_idle) + return; + if (cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)) { /* - * Skip, if setup has overridden idle. * One CPU supports mwait => All CPUs supports mwait */ - if (!pm_idle) { - printk(KERN_INFO "using mwait in idle threads.\n"); - pm_idle = mwait_idle; - } - } - selected = 1; + printk(KERN_INFO "using mwait in idle threads.\n"); + pm_idle = mwait_idle; + } else + pm_idle = default_idle; } static int __init idle_setup(char *str) |