aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/memory_hotplug.c8
-rw-r--r--mm/page_alloc.c2
2 files changed, 7 insertions, 3 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 0095d156324a..ec2f199cc5f7 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -498,12 +498,16 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages)
498 * So, zonelist must be updated after online. 498 * So, zonelist must be updated after online.
499 */ 499 */
500 mutex_lock(&zonelists_mutex); 500 mutex_lock(&zonelists_mutex);
501 if (!populated_zone(zone)) 501 if (!populated_zone(zone)) {
502 need_zonelists_rebuild = 1; 502 need_zonelists_rebuild = 1;
503 build_all_zonelists(NULL, zone);
504 }
503 505
504 ret = walk_system_ram_range(pfn, nr_pages, &onlined_pages, 506 ret = walk_system_ram_range(pfn, nr_pages, &onlined_pages,
505 online_pages_range); 507 online_pages_range);
506 if (ret) { 508 if (ret) {
509 if (need_zonelists_rebuild)
510 zone_pcp_reset(zone);
507 mutex_unlock(&zonelists_mutex); 511 mutex_unlock(&zonelists_mutex);
508 printk(KERN_DEBUG "online_pages [mem %#010llx-%#010llx] failed\n", 512 printk(KERN_DEBUG "online_pages [mem %#010llx-%#010llx] failed\n",
509 (unsigned long long) pfn << PAGE_SHIFT, 513 (unsigned long long) pfn << PAGE_SHIFT,
@@ -519,7 +523,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages)
519 if (onlined_pages) { 523 if (onlined_pages) {
520 node_set_state(zone_to_nid(zone), N_HIGH_MEMORY); 524 node_set_state(zone_to_nid(zone), N_HIGH_MEMORY);
521 if (need_zonelists_rebuild) 525 if (need_zonelists_rebuild)
522 build_all_zonelists(NULL, zone); 526 build_all_zonelists(NULL, NULL);
523 else 527 else
524 zone_pcp_update(zone); 528 zone_pcp_update(zone);
525 } 529 }
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 4dba04f06880..5a7b7611d4e4 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5983,7 +5983,6 @@ void __meminit zone_pcp_update(struct zone *zone)
5983} 5983}
5984#endif 5984#endif
5985 5985
5986#ifdef CONFIG_MEMORY_HOTREMOVE
5987void zone_pcp_reset(struct zone *zone) 5986void zone_pcp_reset(struct zone *zone)
5988{ 5987{
5989 unsigned long flags; 5988 unsigned long flags;
@@ -6003,6 +6002,7 @@ void zone_pcp_reset(struct zone *zone)
6003 local_irq_restore(flags); 6002 local_irq_restore(flags);
6004} 6003}
6005 6004
6005#ifdef CONFIG_MEMORY_HOTREMOVE
6006/* 6006/*
6007 * All pages in the range must be isolated before calling this. 6007 * All pages in the range must be isolated before calling this.
6008 */ 6008 */