memory-hotplug: update memory block's state and notify userspace
authorWen Congyang <[email protected]>
Mon, 8 Oct 2012 23:34:01 +0000 (16:34 -0700)
committerLinus Torvalds <[email protected]>
Tue, 9 Oct 2012 07:23:02 +0000 (16:23 +0900)
commite90bdb7f52f94204c78fb40b0804645defdebd71
tree4acb09ecd1f98fd98408f18e816d075601585d2a
parenta16cee10c7ab994546ed98d9abfd4de74050124a
memory-hotplug: update memory block's state and notify userspace

remove_memory() will be called when hot removing a memory device.  But
even if offlining memory, we cannot notice it.  So the patch updates the
memory block's state and sends notification to userspace.

Additionally, the memory device may contain more than one memory block.
If the memory block has been offlined, __offline_pages() will fail.  So we
should try to offline one memory block at a time.

Thus remove_memory() also check each memory block's state.  So there is no
need to check the memory block's state before calling remove_memory().

Signed-off-by: Wen Congyang <[email protected]>
Signed-off-by: Yasuaki Ishimatsu <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Jiang Liu <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: KOSAKI Motohiro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/base/memory.c
include/linux/memory_hotplug.h
mm/memory_hotplug.c