Skip to content

Commit 1e8537b

Browse files
Xishi Qiutorvalds
authored andcommitted
memory-hotplug: build zonelists when offlining pages
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]>
1 parent 38a7601 commit 1e8537b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mm/memory_hotplug.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,8 +970,13 @@ static int __ref offline_pages(unsigned long start_pfn,
970970

971971
init_per_zone_wmark_min();
972972

973-
if (!populated_zone(zone))
973+
if (!populated_zone(zone)) {
974974
zone_pcp_reset(zone);
975+
mutex_lock(&zonelists_mutex);
976+
build_all_zonelists(NULL, NULL);
977+
mutex_unlock(&zonelists_mutex);
978+
} else
979+
zone_pcp_update(zone);
975980

976981
if (!node_present_pages(node)) {
977982
node_clear_state(node, N_HIGH_MEMORY);

0 commit comments

Comments
 (0)