Commit bce7394a authored by Minchan Kim's avatar Minchan Kim Committed by Linus Torvalds

page-allocator: reset wmark_min and inactive ratio of zone when hotplug happens

Solve two problems.

Whenever memory hotplug sucessfully happens, zone->present_pages
have to be changed.

1) Now memory hotplug calls setup_per_zone_wmark_min only when
   online_pages called, not offline_pages.

   It breaks balance.

2) If zone->present_pages is changed, we also have to change
   zone->inactive_ratio.  That's because inactive_ratio depends on
Signed-off-by: default avatarMinchan Kim <>
Acked-by: default avatarYasunori Goto <>
Cc: Rik van Riel <>
Cc: KOSAKI Motohiro <>
Cc: Johannes Weiner <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 96cb4df5
......@@ -423,6 +423,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
zone->zone_pgdat->node_present_pages += onlined_pages;
if (onlined_pages) {
node_set_state(zone_to_nid(zone), N_HIGH_MEMORY);
......@@ -832,6 +833,9 @@ repeat:
totalram_pages -= offlined_pages;
num_physpages -= offlined_pages;
vm_total_pages = nr_free_pagecache_pages();
......@@ -4397,7 +4397,7 @@ static void setup_per_zone_lowmem_reserve(void)
* setup_per_zone_wmarks - called when min_free_kbytes changes
* or when memory is hot-added
* or when memory is hot-{added|removed}
* Ensures that the watermark[min,low,high] values for each zone are set
* correctly with respect to min_free_kbytes.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment