Skip to content

Commit b3091f1

Browse files
KAGA-KOKOPeter Zijlstra
authored andcommitted
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
1 parent 5490e76 commit b3091f1

3 files changed

Lines changed: 7 additions & 10 deletions

File tree

arch/arm64/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ config ARM64
222222
select HAVE_KPROBES
223223
select HAVE_KRETPROBES
224224
select HAVE_GENERIC_VDSO
225+
select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU
225226
select IRQ_DOMAIN
226227
select IRQ_FORCED_THREADING
227228
select KASAN_VMALLOC if KASAN

arch/arm64/include/asm/smp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static inline void arch_send_wakeup_ipi_mask(const struct cpumask *mask)
9999

100100
extern int __cpu_disable(void);
101101

102-
extern void __cpu_die(unsigned int cpu);
102+
static inline void __cpu_die(unsigned int cpu) { }
103103
extern void __noreturn cpu_die(void);
104104
extern void __noreturn cpu_die_early(void);
105105

arch/arm64/kernel/smp.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -332,17 +332,13 @@ static int op_cpu_kill(unsigned int cpu)
332332
}
333333

334334
/*
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.
337337
*/
338-
void __cpu_die(unsigned int cpu)
338+
void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu)
339339
{
340340
int err;
341341

342-
if (!cpu_wait_death(cpu, 5)) {
343-
pr_crit("CPU%u: cpu didn't die\n", cpu);
344-
return;
345-
}
346342
pr_debug("CPU%u: shutdown\n", cpu);
347343

348344
/*
@@ -369,8 +365,8 @@ void __noreturn cpu_die(void)
369365

370366
local_daif_mask();
371367

372-
/* Tell __cpu_die() that this CPU is now safe to dispose of */
373-
(void)cpu_report_death();
368+
/* Tell cpuhp_bp_sync_dead() that this CPU is now safe to dispose of */
369+
cpuhp_ap_report_dead();
374370

375371
/*
376372
* Actually shutdown the CPU. This must never fail. The specific hotplug

0 commit comments

Comments
 (0)