From 0f1eef3bbe3f024ed46bc063e693ee608d79777b Mon Sep 17 00:00:00 2001 From: Wen Congyang Date: Thu, 25 Oct 2012 12:14:51 +1100 Subject: [PATCH] memory-hotplug: build zonelist if a zone is populated after onlining pages After "memory-hotplug: allocate zone's pcp before onlining pages", we build zone list before onlining pages to allocate zone's pcp. But the zone doesn't have pages before onlining pages, and the zone is not in zonelist, so we still need to build zonelist after onlining pages. 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 Cc: KOSAKI Motohiro Cc: Yasuaki Ishimatsu Signed-off-by: Andrew Morton --- mm/memory_hotplug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 5c8ad6dcd18f..63ea7df124fa 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -529,7 +529,9 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages) zone->zone_pgdat->node_present_pages += onlined_pages; if (onlined_pages) { node_set_state(zone_to_nid(zone), N_HIGH_MEMORY); - if (!need_zonelists_rebuild) + if (need_zonelists_rebuild) + build_all_zonelists(NULL, NULL); + else zone_pcp_update(zone); } -- 2.39.5