Skip to content

Commit

Permalink
x86/idle: Clean up idle selection
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Thomas Gleixner authored and Borislav Petkov (AMD) committed Mar 4, 2024
1 parent cb81dee commit 0ab5628
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions arch/x86/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 0ab5628

Please sign in to comment.