Skip to content

Commit 0ab5628

Browse files
KAGA-KOKObp3tk0v
authored andcommitted
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
1 parent cb81dee commit 0ab5628

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

arch/x86/kernel/process.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -910,11 +910,13 @@ static __cpuidle void mwait_idle(void)
910910

911911
void select_idle_routine(const struct cpuinfo_x86 *c)
912912
{
913-
#ifdef CONFIG_SMP
914-
if (boot_option_idle_override == IDLE_POLL && smp_num_siblings > 1)
915-
pr_warn_once("WARNING: polling idle and HT enabled, performance may degrade\n");
916-
#endif
917-
if (x86_idle_set() || boot_option_idle_override == IDLE_POLL)
913+
if (boot_option_idle_override == IDLE_POLL) {
914+
if (IS_ENABLED(CONFIG_SMP) && smp_num_siblings > 1)
915+
pr_warn_once("WARNING: polling idle and HT enabled, performance may degrade\n");
916+
return;
917+
}
918+
919+
if (x86_idle_set())
918920
return;
919921

920922
if (prefer_mwait_c1_over_halt(c)) {

0 commit comments

Comments
 (0)