* [PATCH v2 0/3] x86/smpboot: Minor cleanup
@ 2023-07-27 18:05 Sohil Mehta
2023-07-27 18:05 ` [PATCH v2 1/3] x86/smpboot: Remove a stray comment about CPU hotplug Sohil Mehta
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Sohil Mehta @ 2023-07-27 18:05 UTC (permalink / raw)
To: x86, Thomas Gleixner, Peter Zijlstra
Cc: Ingo Molnar, Borislav Petkov, Dave Hansen, H . Peter Anvin,
Tony Luck, Sohil Mehta, linux-kernel
These cleanup patches are minor and fairly independent. I have put them in a
series to make it easier to review. Please feel free to apply any of them.
I found these mainly through code inspection.
v2:
- Added 2 more patches
- Rebased to 6.5-rc3
- Improved commit message
v1: https://lore.kernel.org/lkml/20230614201301.1308363-1-sohil.mehta@intel.com/
Sohil Mehta (3):
x86/smpboot: Remove a stray comment about CPU hotplug
x86/smp: Remove a non-existent function declaration
x86/smpboot: Change smp_store_boot_cpu_info() to static
arch/x86/include/asm/smp.h | 3 ---
arch/x86/kernel/smpboot.c | 6 ++----
2 files changed, 2 insertions(+), 7 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/3] x86/smpboot: Remove a stray comment about CPU hotplug
2023-07-27 18:05 [PATCH v2 0/3] x86/smpboot: Minor cleanup Sohil Mehta
@ 2023-07-27 18:05 ` Sohil Mehta
2023-07-28 8:21 ` [tip: x86/core] " tip-bot2 for Sohil Mehta
2023-07-27 18:05 ` [PATCH v2 2/3] x86/smp: Remove a non-existent function declaration Sohil Mehta
2023-07-27 18:05 ` [PATCH v2 3/3] x86/smpboot: Change smp_store_boot_cpu_info() to static Sohil Mehta
2 siblings, 1 reply; 7+ messages in thread
From: Sohil Mehta @ 2023-07-27 18:05 UTC (permalink / raw)
To: x86, Thomas Gleixner, Peter Zijlstra
Cc: Ingo Molnar, Borislav Petkov, Dave Hansen, H . Peter Anvin,
Tony Luck, Sohil Mehta, linux-kernel
This old comment is irrelavant to the logic of disabling interrupts and
could be misleading. Remove it.
Now, hlt_play_dead() resembles the code that the comment was initially
added for, but, it doesn't make sense anymore because an offlined cpu
could also be put into other states such as mwait.
Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
---
arch/x86/kernel/smpboot.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index e1aa2cd7734b..6a09a021b534 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1614,9 +1614,7 @@ void play_dead_common(void)
idle_task_exit();
cpuhp_ap_report_dead();
- /*
- * With physical CPU hotplug, we should halt the cpu
- */
+
local_irq_disable();
}
--
2.34.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 2/3] x86/smp: Remove a non-existent function declaration
2023-07-27 18:05 [PATCH v2 0/3] x86/smpboot: Minor cleanup Sohil Mehta
2023-07-27 18:05 ` [PATCH v2 1/3] x86/smpboot: Remove a stray comment about CPU hotplug Sohil Mehta
@ 2023-07-27 18:05 ` Sohil Mehta
2023-07-28 8:21 ` [tip: x86/core] " tip-bot2 for Sohil Mehta
2023-07-27 18:05 ` [PATCH v2 3/3] x86/smpboot: Change smp_store_boot_cpu_info() to static Sohil Mehta
2 siblings, 1 reply; 7+ messages in thread
From: Sohil Mehta @ 2023-07-27 18:05 UTC (permalink / raw)
To: x86, Thomas Gleixner, Peter Zijlstra
Cc: Ingo Molnar, Borislav Petkov, Dave Hansen, H . Peter Anvin,
Tony Luck, Sohil Mehta, linux-kernel
x86_idle_thread_init() does not exist anywhere. Remove its declaration
from the header.
Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
---
arch/x86/include/asm/smp.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 600cf25dbfc6..094f31d3f950 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -132,7 +132,6 @@ void smp_kick_mwait_play_dead(void);
void native_smp_send_reschedule(int cpu);
void native_send_call_func_ipi(const struct cpumask *mask);
void native_send_call_func_single_ipi(int cpu);
-void x86_idle_thread_init(unsigned int cpu, struct task_struct *idle);
bool smp_park_other_cpus_in_init(void);
--
2.34.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 3/3] x86/smpboot: Change smp_store_boot_cpu_info() to static
2023-07-27 18:05 [PATCH v2 0/3] x86/smpboot: Minor cleanup Sohil Mehta
2023-07-27 18:05 ` [PATCH v2 1/3] x86/smpboot: Remove a stray comment about CPU hotplug Sohil Mehta
2023-07-27 18:05 ` [PATCH v2 2/3] x86/smp: Remove a non-existent function declaration Sohil Mehta
@ 2023-07-27 18:05 ` Sohil Mehta
2023-07-28 8:21 ` [tip: x86/core] " tip-bot2 for Sohil Mehta
2 siblings, 1 reply; 7+ messages in thread
From: Sohil Mehta @ 2023-07-27 18:05 UTC (permalink / raw)
To: x86, Thomas Gleixner, Peter Zijlstra
Cc: Ingo Molnar, Borislav Petkov, Dave Hansen, H . Peter Anvin,
Tony Luck, Sohil Mehta, linux-kernel
The function is only used locally. Convert it to a static one.
Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
---
arch/x86/include/asm/smp.h | 2 --
arch/x86/kernel/smpboot.c | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 094f31d3f950..cf7217ad5701 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -134,8 +134,6 @@ void native_send_call_func_ipi(const struct cpumask *mask);
void native_send_call_func_single_ipi(int cpu);
bool smp_park_other_cpus_in_init(void);
-
-void smp_store_boot_cpu_info(void);
void smp_store_cpu_info(int id);
asmlinkage __visible void smp_reboot_interrupt(void);
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 6a09a021b534..28c590b4b1b1 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -422,7 +422,7 @@ int topology_update_die_map(unsigned int die, unsigned int cpu)
return 0;
}
-void __init smp_store_boot_cpu_info(void)
+static void __init smp_store_boot_cpu_info(void)
{
int id = 0; /* CPU 0 */
struct cpuinfo_x86 *c = &cpu_data(id);
--
2.34.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip: x86/core] x86/smpboot: Change smp_store_boot_cpu_info() to static
2023-07-27 18:05 ` [PATCH v2 3/3] x86/smpboot: Change smp_store_boot_cpu_info() to static Sohil Mehta
@ 2023-07-28 8:21 ` tip-bot2 for Sohil Mehta
0 siblings, 0 replies; 7+ messages in thread
From: tip-bot2 for Sohil Mehta @ 2023-07-28 8:21 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Sohil Mehta, Thomas Gleixner, x86, linux-kernel
The following commit has been merged into the x86/core branch of tip:
Commit-ID: d7114f83ee051dfeac82546d7ba03d74f8b92af3
Gitweb: https://git.kernel.org/tip/d7114f83ee051dfeac82546d7ba03d74f8b92af3
Author: Sohil Mehta <sohil.mehta@intel.com>
AuthorDate: Thu, 27 Jul 2023 18:05:33
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Fri, 28 Jul 2023 10:17:53 +02:00
x86/smpboot: Change smp_store_boot_cpu_info() to static
The function is only used locally. Convert it to a static one.
Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230727180533.3119660-4-sohil.mehta@intel.com
---
arch/x86/include/asm/smp.h | 2 --
arch/x86/kernel/smpboot.c | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 094f31d..cf7217a 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -134,8 +134,6 @@ void native_send_call_func_ipi(const struct cpumask *mask);
void native_send_call_func_single_ipi(int cpu);
bool smp_park_other_cpus_in_init(void);
-
-void smp_store_boot_cpu_info(void);
void smp_store_cpu_info(int id);
asmlinkage __visible void smp_reboot_interrupt(void);
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 6a09a02..28c590b 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -422,7 +422,7 @@ found:
return 0;
}
-void __init smp_store_boot_cpu_info(void)
+static void __init smp_store_boot_cpu_info(void)
{
int id = 0; /* CPU 0 */
struct cpuinfo_x86 *c = &cpu_data(id);
^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip: x86/core] x86/smp: Remove a non-existent function declaration
2023-07-27 18:05 ` [PATCH v2 2/3] x86/smp: Remove a non-existent function declaration Sohil Mehta
@ 2023-07-28 8:21 ` tip-bot2 for Sohil Mehta
0 siblings, 0 replies; 7+ messages in thread
From: tip-bot2 for Sohil Mehta @ 2023-07-28 8:21 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Sohil Mehta, Thomas Gleixner, x86, linux-kernel
The following commit has been merged into the x86/core branch of tip:
Commit-ID: 54bfd02bbfcd0582bc4ebf6fd57fba323b141b5b
Gitweb: https://git.kernel.org/tip/54bfd02bbfcd0582bc4ebf6fd57fba323b141b5b
Author: Sohil Mehta <sohil.mehta@intel.com>
AuthorDate: Thu, 27 Jul 2023 18:05:32
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Fri, 28 Jul 2023 10:17:53 +02:00
x86/smp: Remove a non-existent function declaration
x86_idle_thread_init() does not exist anywhere. Remove its declaration
from the header.
Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230727180533.3119660-3-sohil.mehta@intel.com
---
arch/x86/include/asm/smp.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 600cf25..094f31d 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -132,7 +132,6 @@ void smp_kick_mwait_play_dead(void);
void native_smp_send_reschedule(int cpu);
void native_send_call_func_ipi(const struct cpumask *mask);
void native_send_call_func_single_ipi(int cpu);
-void x86_idle_thread_init(unsigned int cpu, struct task_struct *idle);
bool smp_park_other_cpus_in_init(void);
^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip: x86/core] x86/smpboot: Remove a stray comment about CPU hotplug
2023-07-27 18:05 ` [PATCH v2 1/3] x86/smpboot: Remove a stray comment about CPU hotplug Sohil Mehta
@ 2023-07-28 8:21 ` tip-bot2 for Sohil Mehta
0 siblings, 0 replies; 7+ messages in thread
From: tip-bot2 for Sohil Mehta @ 2023-07-28 8:21 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Sohil Mehta, Thomas Gleixner, x86, linux-kernel
The following commit has been merged into the x86/core branch of tip:
Commit-ID: 52defa4a5e719a57992aed52c8d3e214e75ac276
Gitweb: https://git.kernel.org/tip/52defa4a5e719a57992aed52c8d3e214e75ac276
Author: Sohil Mehta <sohil.mehta@intel.com>
AuthorDate: Thu, 27 Jul 2023 18:05:31
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Fri, 28 Jul 2023 10:17:53 +02:00
x86/smpboot: Remove a stray comment about CPU hotplug
This old comment is irrelavant to the logic of disabling interrupts and
could be misleading. Remove it.
Now, hlt_play_dead() resembles the code that the comment was initially
added for, but, it doesn't make sense anymore because an offlined cpu
could also be put into other states such as mwait.
Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230727180533.3119660-2-sohil.mehta@intel.com
---
arch/x86/kernel/smpboot.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index e1aa2cd..6a09a02 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1614,9 +1614,7 @@ void play_dead_common(void)
idle_task_exit();
cpuhp_ap_report_dead();
- /*
- * With physical CPU hotplug, we should halt the cpu
- */
+
local_irq_disable();
}
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-07-28 8:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-27 18:05 [PATCH v2 0/3] x86/smpboot: Minor cleanup Sohil Mehta
2023-07-27 18:05 ` [PATCH v2 1/3] x86/smpboot: Remove a stray comment about CPU hotplug Sohil Mehta
2023-07-28 8:21 ` [tip: x86/core] " tip-bot2 for Sohil Mehta
2023-07-27 18:05 ` [PATCH v2 2/3] x86/smp: Remove a non-existent function declaration Sohil Mehta
2023-07-28 8:21 ` [tip: x86/core] " tip-bot2 for Sohil Mehta
2023-07-27 18:05 ` [PATCH v2 3/3] x86/smpboot: Change smp_store_boot_cpu_info() to static Sohil Mehta
2023-07-28 8:21 ` [tip: x86/core] " tip-bot2 for Sohil Mehta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®