From: Ingo Molnar Date: Fri, 3 Jul 2009 08:30:27 -0500 Subject: 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 Signed-off-by: Thomas Gleixner [bigeasy: XXX: stopper_lock -> stop_cpus_lock] --- kernel/stop_machine.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c @@ -450,6 +450,16 @@ static void cpu_stopper_thread(unsigned 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();