Skip to contentSkip to conversation

x86/smpboot: Minor cleanup

PATCH Applied Sohil Mehta 2 participants 7 messages Jul 27, 2023 – Jul 28, 2023 x86

lore
Share & tools
lore
#0 lore raw

v2 cover x86/smpboot: Minor cleanup

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/[email protected]/

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(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/3 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.

---
 arch/x86/kernel/smpboot.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/kernel/smpboot.c +1 -3
index e1aa2cd7734b..6a09a021b534 100644
@@ -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();
 }
 
Signature · 1 line
2.34.1
merge bot Applied
#2 lore raw

[tip: x86/core] x86/smpboot: Remove a stray comment about CPU hotplug

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

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 <[email protected]>
AuthorDate:    Thu, 27 Jul 2023 18:05:31 
Committer:     Thomas Gleixner <[email protected]>
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.

---
 arch/x86/kernel/smpboot.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/kernel/smpboot.c +1 -3
index e1aa2cd..6a09a02 100644
@@ -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();
 }
 
#3 lore raw

PATCH v2 2/3 x86/smp: Remove a non-existent function declaration

In reply to Sohil Mehta

x86_idle_thread_init() does not exist anywhere. Remove its declaration from the header.

---
 arch/x86/include/asm/smp.h | 1 -
 1 file changed, 1 deletion(-)
arch/x86/include/asm/smp.h +0 -1
index 600cf25dbfc6..094f31d3f950 100644
@@ -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);
 
Signature · 1 line
2.34.1
merge bot Applied
#4 lore raw

[tip: x86/core] x86/smp: Remove a non-existent function declaration

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

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 <[email protected]>
AuthorDate:    Thu, 27 Jul 2023 18:05:32 
Committer:     Thomas Gleixner <[email protected]>
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.

---
 arch/x86/include/asm/smp.h | 1 -
 1 file changed, 1 deletion(-)
arch/x86/include/asm/smp.h +0 -1
index 600cf25..094f31d 100644
@@ -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);
 
#5 lore raw

PATCH v2 3/3 x86/smpboot: Change smp_store_boot_cpu_info() to static

In reply to Sohil Mehta

The function is only used locally. Convert it to a static one.

---
 arch/x86/include/asm/smp.h | 2 --
 arch/x86/kernel/smpboot.c  | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
arch/x86/include/asm/smp.h +0 -2
index 094f31d3f950..cf7217ad5701 100644
@@ -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);
arch/x86/kernel/smpboot.c +1 -1
index 6a09a021b534..28c590b4b1b1 100644
@@ -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);
Signature · 1 line
2.34.1
merge bot Applied
#6 lore raw

[tip: x86/core] x86/smpboot: Change smp_store_boot_cpu_info() to static

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

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 <[email protected]>
AuthorDate:    Thu, 27 Jul 2023 18:05:33 
Committer:     Thomas Gleixner <[email protected]>
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.

---
 arch/x86/include/asm/smp.h | 2 --
 arch/x86/kernel/smpboot.c  | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
arch/x86/include/asm/smp.h +0 -2
index 094f31d..cf7217a 100644
@@ -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);
arch/x86/kernel/smpboot.c +1 -1
index 6a09a02..28c590b 100644
@@ -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);