]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blob - rt-patches/0099-stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch
rt_patches: required rebase due to printk change
[hercules2020/nv-tegra/linux-4.4.git] / rt-patches / 0099-stop_machine-convert-stop_machine_run-to-PREEMPT_RT.patch
1 From 54139dfd773a22677e9a8f1e49c4123ed3a55f0b Mon Sep 17 00:00:00 2001
2 From: Ingo Molnar <mingo@elte.hu>
3 Date: Fri, 3 Jul 2009 08:30:27 -0500
4 Subject: [PATCH 099/366] stop_machine: convert stop_machine_run() to
5  PREEMPT_RT
6
7 Instead of playing with non-preemption, introduce explicit
8 startup serialization. This is more robust and cleaner as
9 well.
10
11 Signed-off-by: Ingo Molnar <mingo@elte.hu>
12 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
13 [bigeasy: XXX: stopper_lock -> stop_cpus_lock]
14 ---
15  kernel/stop_machine.c | 10 ++++++++++
16  1 file changed, 10 insertions(+)
17
18 diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
19 index a3bbaee..4ef69a3 100644
20 --- a/kernel/stop_machine.c
21 +++ b/kernel/stop_machine.c
22 @@ -450,6 +450,16 @@ repeat:
23                 struct cpu_stop_done *done = work->done;
24                 char ksym_buf[KSYM_NAME_LEN] __maybe_unused;
25  
26 +               /*
27 +                * Wait until the stopper finished scheduling on all
28 +                * cpus
29 +                */
30 +               lg_global_lock(&stop_cpus_lock);
31 +               /*
32 +                * Let other cpu threads continue as well
33 +                */
34 +               lg_global_unlock(&stop_cpus_lock);
35 +
36                 /* cpu stop callbacks are not allowed to sleep */
37                 preempt_disable();
38  
39 -- 
40 1.9.1
41