Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338736
b: refs/heads/master
c: 6dcd73d
h: refs/heads/master
v: v3
  • Loading branch information
Wen Congyang authored and Linus Torvalds committed Dec 12, 2012
1 parent fdc9d72 commit 64c552f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3ac19f8efe26451cacac31d0be34fa9c51114c2a
refs/heads/master: 6dcd73d7011ba9046f9b98e7f7c9d958f5810e6b
8 changes: 6 additions & 2 deletions trunk/mm/memory_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,12 +498,16 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages)
* So, zonelist must be updated after online.
*/
mutex_lock(&zonelists_mutex);
if (!populated_zone(zone))
if (!populated_zone(zone)) {
need_zonelists_rebuild = 1;
build_all_zonelists(NULL, zone);
}

ret = walk_system_ram_range(pfn, nr_pages, &onlined_pages,
online_pages_range);
if (ret) {
if (need_zonelists_rebuild)
zone_pcp_reset(zone);
mutex_unlock(&zonelists_mutex);
printk(KERN_DEBUG "online_pages [mem %#010llx-%#010llx] failed\n",
(unsigned long long) pfn << PAGE_SHIFT,
Expand All @@ -519,7 +523,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages)
if (onlined_pages) {
node_set_state(zone_to_nid(zone), N_HIGH_MEMORY);
if (need_zonelists_rebuild)
build_all_zonelists(NULL, zone);
build_all_zonelists(NULL, NULL);
else
zone_pcp_update(zone);
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -5983,7 +5983,6 @@ void __meminit zone_pcp_update(struct zone *zone)
}
#endif

#ifdef CONFIG_MEMORY_HOTREMOVE
void zone_pcp_reset(struct zone *zone)
{
unsigned long flags;
Expand All @@ -6003,6 +6002,7 @@ void zone_pcp_reset(struct zone *zone)
local_irq_restore(flags);
}

#ifdef CONFIG_MEMORY_HOTREMOVE
/*
* All pages in the range must be isolated before calling this.
*/
Expand Down

0 comments on commit 64c552f

Please sign in to comment.