Skip to content

Commit

Permalink
rcu: Add warning for RCU_FAST_NO_HZ timer firing
Browse files Browse the repository at this point in the history
RCU_FAST_NO_HZ uses a timer to limit the time that a CPU with callbacks
can remain in dyntick-idle mode.  This timer is cancelled when the CPU
exits idle, and therefore should never fire.  However, if the timer
were migrated to some other CPU for whatever reason (1) the timer could
actually fire and (2) firing on some other CPU would fail to wake up the
CPU with callbacks, possibly resulting in sluggishness or a system hang.

This commit therfore adds a WARN_ON_ONCE() to the timer handler in order
to detect this condition.

Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
  • Loading branch information
Paul E. McKenney authored and Paul E. McKenney committed Apr 26, 2012
1 parent c57afe8 commit 79b9a75
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kernel/rcutree_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -2065,6 +2065,7 @@ static bool rcu_cpu_has_nonlazy_callbacks(int cpu)
*/
static void rcu_idle_gp_timer_func(unsigned long unused)
{
WARN_ON_ONCE(1); /* Getting here can hang the system... */
trace_rcu_prep_idle("Timer");
}

Expand Down

0 comments on commit 79b9a75

Please sign in to comment.