浏览代码

ARM: CPU hotplug: ensure correct ordering of unplug

Don't call idle_task_exit() with interrupts disabled, and ensure
that we have a memory barrier after interrupts are disabled but
before signalling that this CPU has shut down.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Russell King 14 年之前
父节点
当前提交
f36d340122
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      arch/arm/kernel/smp.c

+ 3 - 1
arch/arm/kernel/smp.c

@@ -269,9 +269,11 @@ void __ref cpu_die(void)
 {
 	unsigned int cpu = smp_processor_id();
 
-	local_irq_disable();
 	idle_task_exit();
 
+	local_irq_disable();
+	mb();
+
 	/* Tell __cpu_die() that this CPU is now safe to dispose of */
 	complete(&cpu_died);