Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: smp: Switch to hotplug core state synchronization

Switch to the CPU hotplug core state tracking and synchronization
mechanim. No functional change intended.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Tested-by: Helge Deller <deller@gmx.de> # parisc
Tested-by: Guilherme G. Piccoli <gpiccoli@igalia.com> # Steam Deck
Link: https://lore.kernel.org/r/20230512205256.690926018@linutronix.de

authored by

Thomas Gleixner and committed by
Peter Zijlstra
b3091f17 5490e769

+7 -10
+1
arch/arm64/Kconfig
··· 222 222 select HAVE_KPROBES 223 223 select HAVE_KRETPROBES 224 224 select HAVE_GENERIC_VDSO 225 + select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU 225 226 select IRQ_DOMAIN 226 227 select IRQ_FORCED_THREADING 227 228 select KASAN_VMALLOC if KASAN
+1 -1
arch/arm64/include/asm/smp.h
··· 99 99 100 100 extern int __cpu_disable(void); 101 101 102 - extern void __cpu_die(unsigned int cpu); 102 + static inline void __cpu_die(unsigned int cpu) { } 103 103 extern void __noreturn cpu_die(void); 104 104 extern void __noreturn cpu_die_early(void); 105 105
+5 -9
arch/arm64/kernel/smp.c
··· 332 332 } 333 333 334 334 /* 335 - * called on the thread which is asking for a CPU to be shutdown - 336 - * waits until shutdown has completed, or it is timed out. 335 + * Called on the thread which is asking for a CPU to be shutdown after the 336 + * shutdown completed. 337 337 */ 338 - void __cpu_die(unsigned int cpu) 338 + void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu) 339 339 { 340 340 int err; 341 341 342 - if (!cpu_wait_death(cpu, 5)) { 343 - pr_crit("CPU%u: cpu didn't die\n", cpu); 344 - return; 345 - } 346 342 pr_debug("CPU%u: shutdown\n", cpu); 347 343 348 344 /* ··· 365 369 366 370 local_daif_mask(); 367 371 368 - /* Tell __cpu_die() that this CPU is now safe to dispose of */ 369 - (void)cpu_report_death(); 372 + /* Tell cpuhp_bp_sync_dead() that this CPU is now safe to dispose of */ 373 + cpuhp_ap_report_dead(); 370 374 371 375 /* 372 376 * Actually shutdown the CPU. This must never fail. The specific hotplug