Skip to content

Commit 6a949b7

Browse files
committed
rcu: Force on tick when invoking lots of callbacks
Callback invocation can run for a significant time period, and within CONFIG_NO_HZ_FULL=y kernels, this period will be devoid of scheduler-clock interrupts. In-kernel execution without such interrupts can cause all manner of malfunction, with RCU CPU stall warnings being but one result. This commit therefore forces scheduling-clock interrupts on whenever more than a few RCU callbacks are invoked. Because offloaded callback invocation can be preempted, this forcing is withdrawn on each context switch. This in turn requires that the loop invoking RCU callbacks reiterate the forcing periodically. [ paulmck: Apply Joel Fernandes TICK_DEP_MASK_RCU->TICK_DEP_BIT_RCU fix. ] [ paulmck: Remove NO_HZ_FULL check per Frederic Weisbecker feedback. ] Signed-off-by: Paul E. McKenney <[email protected]>
1 parent ae9e557 commit 6a949b7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/rcu/tree.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,6 +2151,7 @@ static void rcu_do_batch(struct rcu_data *rdp)
21512151
rcu_nocb_unlock_irqrestore(rdp, flags);
21522152

21532153
/* Invoke callbacks. */
2154+
tick_dep_set_task(current, TICK_DEP_BIT_RCU);
21542155
rhp = rcu_cblist_dequeue(&rcl);
21552156
for (; rhp; rhp = rcu_cblist_dequeue(&rcl)) {
21562157
debug_rcu_head_unqueue(rhp);
@@ -2217,6 +2218,7 @@ static void rcu_do_batch(struct rcu_data *rdp)
22172218
/* Re-invoke RCU core processing if there are callbacks remaining. */
22182219
if (!offloaded && rcu_segcblist_ready_cbs(&rdp->cblist))
22192220
invoke_rcu_core();
2221+
tick_dep_clear_task(current, TICK_DEP_BIT_RCU);
22202222
}
22212223

22222224
/*

0 commit comments

Comments
 (0)