diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2011-05-24 20:11:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 11:39:09 -0400 |
commit | 1b79acc91115ba47e744b70bb166b77bd94f5855 (patch) | |
tree | 9097834522de3840845368312c09b5ad4a98e5e5 /mm/memory_hotplug.c | |
parent | 839a4fcc8af7412be2efd11f0bd0504757f79f08 (diff) |
mm, mem-hotplug: recalculate lowmem_reserve when memory hotplug occurs
Currently, memory hotplug calls setup_per_zone_wmarks() and
calculate_zone_inactive_ratio(), but doesn't call
setup_per_zone_lowmem_reserve().
It means the number of reserved pages aren't updated even if memory hot
plug occur. This patch fixes it.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory_hotplug.c')
-rw-r--r-- | mm/memory_hotplug.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 2c4edc459fb0..59ac18fefd65 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
@@ -459,8 +459,9 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages) | |||
459 | zone_pcp_update(zone); | 459 | zone_pcp_update(zone); |
460 | 460 | ||
461 | mutex_unlock(&zonelists_mutex); | 461 | mutex_unlock(&zonelists_mutex); |
462 | setup_per_zone_wmarks(); | 462 | |
463 | calculate_zone_inactive_ratio(zone); | 463 | init_per_zone_wmark_min(); |
464 | |||
464 | if (onlined_pages) { | 465 | if (onlined_pages) { |
465 | kswapd_run(zone_to_nid(zone)); | 466 | kswapd_run(zone_to_nid(zone)); |
466 | node_set_state(zone_to_nid(zone), N_HIGH_MEMORY); | 467 | node_set_state(zone_to_nid(zone), N_HIGH_MEMORY); |
@@ -893,8 +894,8 @@ repeat: | |||
893 | zone->zone_pgdat->node_present_pages -= offlined_pages; | 894 | zone->zone_pgdat->node_present_pages -= offlined_pages; |
894 | totalram_pages -= offlined_pages; | 895 | totalram_pages -= offlined_pages; |
895 | 896 | ||
896 | setup_per_zone_wmarks(); | 897 | init_per_zone_wmark_min(); |
897 | calculate_zone_inactive_ratio(zone); | 898 | |
898 | if (!node_present_pages(node)) { | 899 | if (!node_present_pages(node)) { |
899 | node_clear_state(node, N_HIGH_MEMORY); | 900 | node_clear_state(node, N_HIGH_MEMORY); |
900 | kswapd_stop(node); | 901 | kswapd_stop(node); |