From: Wen Congyang Date: Fri, 9 Nov 2012 03:04:01 +0000 (+1100) Subject: memory-hotplug: auto offline page_cgroup when onlining memory block failed X-Git-Tag: next-20121113~6^2~250 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=367b4150b4d79aef7d53806c09d79bbbc5a2ca0a;p=karo-tx-linux.git memory-hotplug: auto offline page_cgroup when onlining memory block failed When a memory block is onlined, we will try allocate memory on that node to store page_cgroup. If onlining the memory block failed, we don't offline the page cgroup, and we have no chance to offline this page cgroup unless the memory block is onlined successfully again. It will cause that we can't hot-remove the memory device on that node, because some memory is used to store page cgroup. If onlining the memory block is failed, there is no need to stort page cgroup for this memory. So auto offline page_cgroup when onlining memory block failed. Signed-off-by: Wen Congyang Cc: David Rientjes Cc: Jiang Liu Cc: Len Brown Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Christoph Lameter Cc: Minchan Kim Acked-by: KOSAKI Motohiro Cc: Yasuaki Ishimatsu Cc: Dave Hansen Cc: Mel Gorman Signed-off-by: Andrew Morton --- diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c index 5ddad0c6daa6..44db00e253ed 100644 --- a/mm/page_cgroup.c +++ b/mm/page_cgroup.c @@ -251,6 +251,9 @@ static int __meminit page_cgroup_callback(struct notifier_block *self, mn->nr_pages, mn->status_change_nid); break; case MEM_CANCEL_ONLINE: + offline_page_cgroup(mn->start_pfn, + mn->nr_pages, mn->status_change_nid); + break; case MEM_GOING_OFFLINE: break; case MEM_ONLINE: