Skip to content

Commit 4569c5e

Browse files
committed
rcu/nocb: Add a warning for non-GP kthread running GP code
This commit increases RCU's ability to defend itself by emitting a warning if one of the nocb CB kthreads invokes the GP kthread's wait function. This warning augments a similar check that is carried out at the end of rcutorture testing and when RCU CPU stall warnings are emitted. The problem with those checks is that the miscreants have long since departed and disposed of any and all evidence. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent c0f97f2 commit 4569c5e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎kernel/rcu/tree_plugin.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,6 +1926,7 @@ static void nocb_gp_wait(struct rcu_data *my_rdp)
19261926
* nearest grace period (if any) to wait for next. The CB kthreads
19271927
* and the global grace-period kthread are awakened if needed.
19281928
*/
1929+
WARN_ON_ONCE(my_rdp->nocb_gp_rdp != my_rdp);
19291930
for (rdp = my_rdp; rdp; rdp = rdp->nocb_next_cb_rdp) {
19301931
trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("Check"));
19311932
rcu_nocb_lock_irqsave(rdp, flags);

0 commit comments

Comments
 (0)