Skip to content

Commit

Permalink
memory-hotplug: build zonelists when offlining pages
Browse files Browse the repository at this point in the history
online_pages() does build_all_zonelists() and zone_pcp_update(), I think
offline_pages() should do it too.

When the zone has no memory to allocate, remove it from other nodes'
zonelists.  zone_batchsize() depends on zone's present pages, if zone's
present pages are changed, zone's pcp should be updated.

Signed-off-by: Xishi Qiu <[email protected]>
Cc: Yasuaki Ishimatsu <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Xishi Qiu authored and torvalds committed Oct 9, 2012
1 parent 38a7601 commit 1e8537b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mm/memory_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,8 +970,13 @@ static int __ref offline_pages(unsigned long start_pfn,

init_per_zone_wmark_min();

if (!populated_zone(zone))
if (!populated_zone(zone)) {
zone_pcp_reset(zone);
mutex_lock(&zonelists_mutex);
build_all_zonelists(NULL, NULL);
mutex_unlock(&zonelists_mutex);
} else
zone_pcp_update(zone);

if (!node_present_pages(node)) {
node_clear_state(node, N_HIGH_MEMORY);
Expand Down

0 comments on commit 1e8537b

Please sign in to comment.