]> rtime.felk.cvut.cz Git - zynq/linux.git/commit
rcutree/rcu_bh_qs: disable irq while calling rcu_preempt_qs()
authorTiejun Chen <tiejun.chen@windriver.com>
Wed, 18 Dec 2013 09:51:49 +0000 (17:51 +0800)
committerMichal Sojka <sojka@merica.cz>
Sun, 13 Sep 2015 07:47:26 +0000 (09:47 +0200)
commit2f8d189c3779075396a95ba85d3e09ba9a55f06c
tree474a66f2419fb8e0e6a91e61568b6946b8c340a9
parentf15e1f48da6e1c9e076c3408e27b75b92996d4a2
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>
kernel/rcu/tree.c