diff options
author | Tiejun Chen <tiejun.chen@windriver.com> | 2013-12-18 09:51:49 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-10 00:19:33 (GMT) |
commit | 854fa50d6557c610f4c247601da99c6cb286abc3 (patch) | |
tree | 38d74f0d45ee35910e335c1c7d283725e539f2dc /kernel/rcutree.c | |
parent | 61f4e30bfb1b99f73366e3564ab173def41a5a4c (diff) | |
download | linux-fsl-qoriq-854fa50d6557c610f4c247601da99c6cb286abc3.tar.xz |
rcutree/rcu_bh_qs: disable irq while calling rcu_preempt_qs()
Any callers to the function rcu_preempt_qs() must disable irqs in
order to protect the assignment to ->rcu_read_unlock_special. In
RT case, rcu_bh_qs() as the wrapper of rcu_preempt_qs() is called
in some scenarios where irq is enabled, like this path,
do_single_softirq()
|
+ local_irq_enable();
+ handle_softirq()
| |
| + rcu_bh_qs()
| |
| + rcu_preempt_qs()
|
+ local_irq_disable()
So here we'd better disable irq directly inside of rcu_bh_qs() to
fix this, otherwise the kernel may be freezable sometimes as
observed. And especially this way is also kind and safe for the
potential rcu_bh_qs() usage elsewhere in the future.
Cc: stable-rt@vger.kernel.org
Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
Signed-off-by: Bin Jiang <bin.jiang@windriver.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r-- | kernel/rcutree.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 8104cb2..cae59e3 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c @@ -204,7 +204,12 @@ static void rcu_preempt_qs(int cpu); void rcu_bh_qs(int cpu) { + unsigned long flags; + + /* Callers to this function, rcu_preempt_qs(), must disable irqs. */ + local_irq_save(flags); rcu_preempt_qs(cpu); + local_irq_restore(flags); } #else void rcu_bh_qs(int cpu) |