]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
memory-hotplug: build zonelist if a zone is populated after onlining pages
authorWen Congyang <wency@cn.fujitsu.com>
Fri, 9 Nov 2012 03:04:03 +0000 (14:04 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 13 Nov 2012 05:15:22 +0000 (16:15 +1100)
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 <wency@cn.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Jiang Liu <liuj97@gmail.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory_hotplug.c

index 5c8ad6dcd18f4a4e95883cbd0fe4dc86960f1cf1..63ea7df124faa29e4cacd6c42d703df84ac58f48 100644 (file)
@@ -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);
        }