2024-02-29 14:26:17

by Thomas Gleixner

[permalink] [raw]
Subject: [patch 3/6] x86/idle: Clean up idle selection

Clean up the code to make it readable. No functional change.

Signed-off-by: Thomas Gleixner <[email protected]>
---
arch/x86/kernel/process.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

--- 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)) {



Subject: [tip: x86/core] x86/idle: Clean up idle selection

The following commit has been merged into the x86/core branch of tip:

Commit-ID: 18a9f4806dcb33ed7eab93232d13facf5c6e2b70
Gitweb: https://git.kernel.org/tip/18a9f4806dcb33ed7eab93232d13facf5c6e2b70
Author: Thomas Gleixner <[email protected]>
AuthorDate: Thu, 29 Feb 2024 15:23:38 +01:00
Committer: Borislav Petkov (AMD) <[email protected]>
CommitterDate: Fri, 01 Mar 2024 21:33:12 +01:00

x86/idle: Clean up idle selection

Clean up the code to make it readable. No functional change.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
arch/x86/kernel/process.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 5853d56..b6512f7 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)) {

Subject: [tip: x86/core] x86/idle: Clean up idle selection

The following commit has been merged into the x86/core branch of tip:

Commit-ID: 0ab562875c01c91ec8167f8f6593ea61e510fd0a
Gitweb: https://git.kernel.org/tip/0ab562875c01c91ec8167f8f6593ea61e510fd0a
Author: Thomas Gleixner <[email protected]>
AuthorDate: Thu, 29 Feb 2024 15:23:38 +01:00
Committer: Borislav Petkov (AMD) <[email protected]>
CommitterDate: Mon, 04 Mar 2024 17:39:24 +01:00

x86/idle: Clean up idle selection

Clean up the code to make it readable. No functional change.

Signed-off-by: Thomas Gleixner <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
arch/x86/kernel/process.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index b86ff0f..792394b 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)) {