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

ARM: 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: 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.635326070@linutronix.de

authored by

Thomas Gleixner and committed by
Peter Zijlstra
5490e769 5356297d

+9 -12
+1
arch/arm/Kconfig
··· 124 124 select HAVE_SYSCALL_TRACEPOINTS 125 125 select HAVE_UID16 126 126 select HAVE_VIRT_CPU_ACCOUNTING_GEN 127 + select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU 127 128 select IRQ_FORCED_THREADING 128 129 select MODULES_USE_ELF_REL 129 130 select NEED_DMA_MAP_STATE
+1 -1
arch/arm/include/asm/smp.h
··· 64 64 65 65 extern int __cpu_disable(void); 66 66 67 - extern void __cpu_die(unsigned int cpu); 67 + static inline void __cpu_die(unsigned int cpu) { } 68 68 69 69 extern void arch_send_call_function_single_ipi(int cpu); 70 70 extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
+7 -11
arch/arm/kernel/smp.c
··· 288 288 } 289 289 290 290 /* 291 - * called on the thread which is asking for a CPU to be shutdown - 292 - * waits until shutdown has completed, or it is timed out. 291 + * called on the thread which is asking for a CPU to be shutdown after the 292 + * shutdown completed. 293 293 */ 294 - void __cpu_die(unsigned int cpu) 294 + void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu) 295 295 { 296 - if (!cpu_wait_death(cpu, 5)) { 297 - pr_err("CPU%u: cpu didn't die\n", cpu); 298 - return; 299 - } 300 296 pr_debug("CPU%u: shutdown\n", cpu); 301 297 302 298 clear_tasks_mm_cpumask(cpu); ··· 332 336 flush_cache_louis(); 333 337 334 338 /* 335 - * Tell __cpu_die() that this CPU is now safe to dispose of. Once 336 - * this returns, power and/or clocks can be removed at any point 337 - * from this CPU and its cache by platform_cpu_kill(). 339 + * Tell cpuhp_bp_sync_dead() that this CPU is now safe to dispose 340 + * of. Once this returns, power and/or clocks can be removed at 341 + * any point from this CPU and its cache by platform_cpu_kill(). 338 342 */ 339 - (void)cpu_report_death(); 343 + cpuhp_ap_report_dead(); 340 344 341 345 /* 342 346 * Ensure that the cache lines associated with that completion are