]> git.karo-electronics.de Git - karo-tx-linux.git/commit
rcu: Disallow callback registry on offline CPUs
authorPaul E. McKenney <paul.mckenney@linaro.org>
Fri, 3 Aug 2012 20:16:15 +0000 (13:16 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 4 Sep 2012 23:53:46 +0000 (16:53 -0700)
commitf9c9512256a63ede96d923d540e75388f51bd7a5
tree46a3a9eaa8cf180fe3eb68e85b72ff51746bdfbe
parent0efb1a031e882a9376dddcbb68e81381fb055a3d
rcu: Disallow callback registry on offline CPUs

Posting a callback after the CPU_DEAD notifier effectively leaks
that callback unless/until that CPU comes back online.  Silence is
unhelpful when attempting to track down such leaks, so this commit emits
a WARN_ON_ONCE() and unconditionally leaks the callback when an offline
CPU attempts to register a callback.  The rdp->nxttail[RCU_NEXT_TAIL] is
set to NULL in the CPU_DEAD notifier and restored in the CPU_UP_PREPARE
notifier, allowing _call_rcu() to determine exactly when posting callbacks
is illegal.

Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
kernel/rcutree.c