X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=mm%2Fmemory_hotplug.c;h=9c12ae5e3695af07d44b9d60fe3782fdb16903a5;hb=ee3c72a14bfecdf783738032ff3c73ef6412f5b3;hp=0c055a090f4df19e042312e2a30cef3140fb8558;hpb=9b3a89f8b052f2a6193a9691e053f986144a65a0;p=linux-2.6 diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 0c055a090f..9c12ae5e36 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -65,13 +65,15 @@ static int __add_zone(struct zone *zone, unsigned long phys_start_pfn) int zone_type; zone_type = zone - pgdat->node_zones; - if (!populated_zone(zone)) { + if (!zone->wait_table) { int ret = 0; - ret = init_currently_empty_zone(zone, phys_start_pfn, nr_pages); + ret = init_currently_empty_zone(zone, phys_start_pfn, + nr_pages, MEMMAP_HOTPLUG); if (ret < 0) return ret; } - memmap_init_zone(nr_pages, nid, zone_type, phys_start_pfn); + memmap_init_zone(nr_pages, nid, zone_type, + phys_start_pfn, MEMMAP_HOTPLUG); return 0; } @@ -215,6 +217,10 @@ int online_pages(unsigned long pfn, unsigned long nr_pages) zone->zone_pgdat->node_present_pages += onlined_pages; setup_per_zone_pages_min(); + if (onlined_pages) { + kswapd_run(zone_to_nid(zone)); + node_set_state(zone_to_nid(zone), N_HIGH_MEMORY); + } if (need_zonelists_rebuild) build_all_zonelists(); @@ -269,9 +275,6 @@ int add_memory(int nid, u64 start, u64 size) if (!pgdat) return -ENOMEM; new_pgdat = 1; - ret = kswapd_run(nid); - if (ret) - goto error; } /* call arch's memory hotadd */