summaryrefslogtreecommitdiff
path: root/kernel/cpu.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2013-11-06 06:50:37 (GMT)
committerIngo Molnar <mingo@kernel.org>2013-11-06 06:50:37 (GMT)
commitc90423d1de12fbeaf0c898e1db0e962de347302b (patch)
tree8c7a32b37e74155324ae2b556fcc42718ccf29a3 /kernel/cpu.c
parentecf1f014325ba60f4df35edae1a357c67c5d4eb1 (diff)
parentb8a216269ec0ce2e961d32e6d640d7010b8a818e (diff)
downloadlinux-c90423d1de12fbeaf0c898e1db0e962de347302b.tar.xz
Merge branch 'sched/core' into core/locking, to prepare the kernel/locking/ file move
Conflicts: kernel/Makefile There are conflicts in kernel/Makefile due to file moving in the scheduler tree - resolve them. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r--kernel/cpu.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index d7f07a2..63aa50d 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -308,6 +308,23 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
}
smpboot_park_threads(cpu);
+ /*
+ * By now we've cleared cpu_active_mask, wait for all preempt-disabled
+ * and RCU users of this state to go away such that all new such users
+ * will observe it.
+ *
+ * For CONFIG_PREEMPT we have preemptible RCU and its sync_rcu() might
+ * not imply sync_sched(), so explicitly call both.
+ */
+#ifdef CONFIG_PREEMPT
+ synchronize_sched();
+#endif
+ synchronize_rcu();
+
+ /*
+ * So now all preempt/rcu users must observe !cpu_active().
+ */
+
err = __stop_machine(take_cpu_down, &tcd_param, cpumask_of(cpu));
if (err) {
/* CPU didn't die: tell everyone. Can't complain. */