]> git.karo-electronics.de Git - karo-tx-linux.git/commit
rcu: Ensure that RCU_FAST_NO_HZ timers expire on correct CPU
authorPaul E. McKenney <paul.mckenney@linaro.org>
Thu, 15 Mar 2012 19:16:26 +0000 (12:16 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 25 Apr 2012 03:55:20 +0000 (20:55 -0700)
commit86df135551bd681a3508d27cf7e34043dee79c81
tree011dd4910eff2ece6063978d2eb83f813e71e4b6
parentc57afe80db4e169135eb675acc2d241e26cc064e
rcu: Ensure that RCU_FAST_NO_HZ timers expire on correct CPU

Timers are subject to migration, which can lead to the following
system-hang scenario when CONFIG_RCU_FAST_NO_HZ=y:

1. CPU 0 executes synchronize_rcu(), which posts an RCU callback.

2. CPU 0 then goes idle.  It cannot immediately invoke the callback,
but there is nothing RCU needs from ti, so it enters dyntick-idle
mode after posting a timer.

3. The timer gets migrated to CPU 1.

4. CPU 0 never wakes up, so the synchronize_rcu() never returns, so
the system hangs.

This commit fixes this problem by using add_timer_on() to ensure that
the timer remains on the CPU that posted it.

Reported-by: Dipankar Sarma <dipankar@in.ibm.com>
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcutree_plugin.h