memory hotplug: one more lock on memory hotplug
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tue, 11 Jan 2011 07:44:01 +0000 (16:44 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Feb 2011 23:14:50 +0000 (15:14 -0800)
commit0712c4990d19ec76ae90789e4aac1dacc7ffa79b
tree15ed903c387eb24cff1270b5408a7effdf411fab
parent4c9a57b6e054a139b69fe7757f7e6234170b58d3
memory hotplug: one more lock on memory hotplug

commit 925268a06dc2b1ff7bfcc37419a6827a0e739639 upstream.

Now, memory_hotplug_(un)lock() is used for add/remove/offline pages
for avoiding races with hibernation. But this should be held in
online_pages(), too. It seems asymmetric.

There are cases where one has to avoid a race with memory hotplug
notifier and his own local code, and hotplug v.s. hotplug.
This will add a generic solution for avoiding races. In other view,
having lock here has no big impacts. online pages is tend to be
done by udev script at el against each memory section one by one.

Then, it's better to have lock here, too.

Reviewed-by: Christoph Lameter <cl@linux.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/linux/memory_hotplug.h
mm/memory_hotplug.c