2016-05-17 22:40:10 +00:00
|
|
|
From: Ingo Molnar <mingo@elte.hu>
|
|
|
|
Date: Fri, 3 Jul 2009 08:30:27 -0500
|
|
|
|
Subject: stop_machine: convert stop_machine_run() to PREEMPT_RT
|
2016-12-12 19:54:49 +00:00
|
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.8/older/patches-4.8.14-rt9.tar.xz
|
2016-05-17 22:40:10 +00:00
|
|
|
|
|
|
|
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]
|
|
|
|
---
|
|
|
|
kernel/stop_machine.c | 10 ++++++++++
|
|
|
|
1 file changed, 10 insertions(+)
|
|
|
|
|
|
|
|
--- a/kernel/stop_machine.c
|
|
|
|
+++ b/kernel/stop_machine.c
|
2016-10-11 18:58:48 +00:00
|
|
|
@@ -460,6 +460,16 @@ static void cpu_stopper_thread(unsigned
|
2016-05-17 22:40:10 +00:00
|
|
|
struct cpu_stop_done *done = work->done;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * 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 must not sleep, make in_atomic() == T */
|
|
|
|
preempt_count_inc();
|
|
|
|
ret = fn(arg);
|