diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2024-02-29 15:23:38 +0100 |
---|---|---|
committer | Borislav Petkov (AMD) <bp@alien8.de> | 2024-03-04 17:39:24 +0100 |
commit | 0ab562875c01c91ec8167f8f6593ea61e510fd0a (patch) | |
tree | 6bd034b7574cd742aedebd75a96a6dd71b3f4a22 | |
parent | cb81deefb59de01325ab822f900c13941bfaf67f (diff) |
x86/idle: Clean up idle selection
Clean up the code to make it readable. No functional change.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20240229142248.392017685@linutronix.de
-rw-r--r-- | arch/x86/kernel/process.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index b86ff0ffe59a..792394be4e60 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -910,11 +910,13 @@ static __cpuidle void mwait_idle(void) void select_idle_routine(const struct cpuinfo_x86 *c) { -#ifdef CONFIG_SMP - if (boot_option_idle_override == IDLE_POLL && smp_num_siblings > 1) - pr_warn_once("WARNING: polling idle and HT enabled, performance may degrade\n"); -#endif - if (x86_idle_set() || boot_option_idle_override == IDLE_POLL) + if (boot_option_idle_override == IDLE_POLL) { + if (IS_ENABLED(CONFIG_SMP) && smp_num_siblings > 1) + pr_warn_once("WARNING: polling idle and HT enabled, performance may degrade\n"); + return; + } + + if (x86_idle_set()) return; if (prefer_mwait_c1_over_halt(c)) { |