aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-07-03 08:30:27 -0500
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>2016-02-13 00:34:57 +0100
commit019b4bd2908ee8e228b72c7d9d9f0dca9764b177 (patch)
tree24ae62e7f3baa59cec94709feb04cae4a58434b2
parent15eb6958cd80815f1113489e3ccdc50d35368015 (diff)
downloadrt-linux-019b4bd2908ee8e228b72c7d9d9f0dca9764b177.tar.gz
stop_machine: convert stop_machine_run() to PREEMPT_RT
Instead of playing with non-preemption, introduce explicit startup serialization. This is more robust and cleaner as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> [bigeasy: XXX: stopper_lock -> stop_cpus_lock]
-rw-r--r--kernel/stop_machine.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index a3bbaee77c586e..4ef69a3cc8110d 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -450,6 +450,16 @@ repeat:
struct cpu_stop_done *done = work->done;
char ksym_buf[KSYM_NAME_LEN] __maybe_unused;
+ /*
+ * Wait until the stopper finished scheduling on all
+ * cpus
+ */
+ lg_global_lock(&stop_cpus_lock);
+ /*
+ * Let other cpu threads continue as well
+ */
+ lg_global_unlock(&stop_cpus_lock);
+
/* cpu stop callbacks are not allowed to sleep */
preempt_disable();