]> git.baikalelectronics.ru Git - kernel.git/commit
Fix PREEMPT_RCU without HOTPLUG_CPU
authorNick Piggin <nickpiggin@yahoo.com.au>
Thu, 10 Jul 2008 07:25:35 +0000 (17:25 +1000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 10 Jul 2008 18:13:44 +0000 (11:13 -0700)
commit4d2af7ad6106227bef7cb38667e4d66454c15f66
tree93e5922ec3ef2c9c9537ab61cfe34ae3980180e7
parentbffa0f6e7d39cecfe751712e0b524c96683c4b34
Fix PREEMPT_RCU without HOTPLUG_CPU

PREEMPT_RCU without HOTPLUG_CPU is broken.  The rcu_online_cpu is called
to initially populate rcu_cpu_online_map with all online CPUs when the
hotplug event handler is installed, and also to populate the map with
CPUs as they come online.  The former case is meant to happen with and
without HOTPLUG_CPU, but without HOTPLUG_CPU, the rcu_offline_cpu
function is no-oped -- while it still gets called, it does not set the
rcu CPU map.

With a blank RCU CPU map, grace periods get to tick by completely
oblivious to active RCU read side critical sections.  This results in
free-before-grace bugs.

Fix is obvious once the problem is known. (Also, change __devinit to
__cpuinit so the function gets thrown away on !HOTPLUG_CPU kernels).

Signed-off-by: Nick Piggin <npiggin@suse.de>
Reported-and-tested-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
[ Nick is my personal hero of the day - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/rcupreempt.c