提交 0f58d2ac 编写于 作者: N Neeraj Upadhyay 提交者: Paul E. McKenney

rcu: Fix self-wakeups for grace-period kthread

The current rcu_gp_kthread_wake() function uses in_interrupt()
and thus does a self-wakeup from all interrupt contexts, including
the pointless case where the GP kthread happens to be running with
bottom halves disabled, along with the impossible case where the GP
kthread is running within an NMI handler (you are not supposed to invoke
rcu_gp_kthread_wake() from within an NMI handler.  This commit therefore
replaces the in_interrupt() with in_irq(), so that the self-wakeups
happen only from handlers for hardware interrupts and softirqs.
This also makes the code match the comment.
Signed-off-by: NNeeraj Upadhyay <neeraju@codeaurora.org>
Signed-off-by: NPaul E. McKenney <paulmck@linux.ibm.com>
Acked-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
上级 497e4260
...@@ -1585,7 +1585,7 @@ static bool rcu_future_gp_cleanup(struct rcu_node *rnp) ...@@ -1585,7 +1585,7 @@ static bool rcu_future_gp_cleanup(struct rcu_node *rnp)
static void rcu_gp_kthread_wake(void) static void rcu_gp_kthread_wake(void)
{ {
if ((current == rcu_state.gp_kthread && if ((current == rcu_state.gp_kthread &&
!in_interrupt() && !in_serving_softirq()) || !in_irq() && !in_serving_softirq()) ||
!READ_ONCE(rcu_state.gp_flags) || !READ_ONCE(rcu_state.gp_flags) ||
!rcu_state.gp_kthread) !rcu_state.gp_kthread)
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册