cpu hotplug: simplify and hopefully fix locking
authorLinus Torvalds <torvalds@macmini.osdl.org>
Sun, 23 Jul 2006 19:12:16 +0000 (12:12 -0700)
committerLinus Torvalds <torvalds@macmini.osdl.org>
Sun, 23 Jul 2006 19:12:16 +0000 (12:12 -0700)
commitaa95387774039096c11803c04011f1aa42d85758
treeb8d3c845efedc2d67bcaff0038b4306fa375379c
parent2cd7cbdf4bd0d0fe58e4dc903e8b413412595504
cpu hotplug: simplify and hopefully fix locking

The CPU hotplug locking was quite messy, with a recursive lock to
handle the fact that both the actual up/down sequence wanted to
protect itself from being re-entered, but the callbacks that it
called also tended to want to protect themselves from CPU events.

This splits the lock into two (one to serialize the whole hotplug
sequence, the other to protect against the CPU present bitmaps
changing). The latter still allows recursive usage because some
subsystems (ondemand policy for cpufreq at least) had already gotten
too used to the lax locking, but the locking mistakes are hopefully
now less fundamental, and we now warn about recursive lock usage
when we see it, in the hope that it can be fixed.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/cpu.h
kernel/cpu.c