diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2011-05-24 20:11:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 11:39:09 -0400 |
commit | a6cccdc36c966e51fd969560d870cfd37afbfa9c (patch) | |
tree | 17c48382275e1852604e4a513121760a013dd2c6 | |
parent | 1b79acc91115ba47e744b70bb166b77bd94f5855 (diff) |
mm, mem-hotplug: update pcp->stat_threshold when memory hotplug occur
Currently, cpu hotplug updates pcp->stat_threshold, but memory hotplug
doesn't. There is no reason for this.
[akpm@linux-foundation.org: fix CONFIG_SMP=n build]
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>
Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/linux/vmstat.h | 3 | ||||
-rw-r--r-- | mm/page_alloc.c | 2 | ||||
-rw-r--r-- | mm/vmstat.c | 3 |
3 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index e73d1030f2f7..51359837511a 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -261,6 +261,7 @@ extern void dec_zone_state(struct zone *, enum zone_stat_item); | |||
261 | extern void __dec_zone_state(struct zone *, enum zone_stat_item); | 261 | extern void __dec_zone_state(struct zone *, enum zone_stat_item); |
262 | 262 | ||
263 | void refresh_cpu_vm_stats(int); | 263 | void refresh_cpu_vm_stats(int); |
264 | void refresh_zone_stat_thresholds(void); | ||
264 | 265 | ||
265 | int calculate_pressure_threshold(struct zone *zone); | 266 | int calculate_pressure_threshold(struct zone *zone); |
266 | int calculate_normal_threshold(struct zone *zone); | 267 | int calculate_normal_threshold(struct zone *zone); |
@@ -313,6 +314,8 @@ static inline void __dec_zone_page_state(struct page *page, | |||
313 | #define set_pgdat_percpu_threshold(pgdat, callback) { } | 314 | #define set_pgdat_percpu_threshold(pgdat, callback) { } |
314 | 315 | ||
315 | static inline void refresh_cpu_vm_stats(int cpu) { } | 316 | static inline void refresh_cpu_vm_stats(int cpu) { } |
317 | static inline void refresh_zone_stat_thresholds(void) { } | ||
318 | |||
316 | #endif /* CONFIG_SMP */ | 319 | #endif /* CONFIG_SMP */ |
317 | 320 | ||
318 | extern const char * const vmstat_text[]; | 321 | extern const char * const vmstat_text[]; |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e133cea36932..77773329aa72 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/memory_hotplug.h> | 39 | #include <linux/memory_hotplug.h> |
40 | #include <linux/nodemask.h> | 40 | #include <linux/nodemask.h> |
41 | #include <linux/vmalloc.h> | 41 | #include <linux/vmalloc.h> |
42 | #include <linux/vmstat.h> | ||
42 | #include <linux/mempolicy.h> | 43 | #include <linux/mempolicy.h> |
43 | #include <linux/stop_machine.h> | 44 | #include <linux/stop_machine.h> |
44 | #include <linux/sort.h> | 45 | #include <linux/sort.h> |
@@ -5152,6 +5153,7 @@ int __meminit init_per_zone_wmark_min(void) | |||
5152 | if (min_free_kbytes > 65536) | 5153 | if (min_free_kbytes > 65536) |
5153 | min_free_kbytes = 65536; | 5154 | min_free_kbytes = 65536; |
5154 | setup_per_zone_wmarks(); | 5155 | setup_per_zone_wmarks(); |
5156 | refresh_zone_stat_thresholds(); | ||
5155 | setup_per_zone_lowmem_reserve(); | 5157 | setup_per_zone_lowmem_reserve(); |
5156 | setup_per_zone_inactive_ratio(); | 5158 | setup_per_zone_inactive_ratio(); |
5157 | return 0; | 5159 | return 0; |
diff --git a/mm/vmstat.c b/mm/vmstat.c index 209546a8bdd5..20c18b7694b2 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c | |||
@@ -157,7 +157,7 @@ int calculate_normal_threshold(struct zone *zone) | |||
157 | /* | 157 | /* |
158 | * Refresh the thresholds for each zone. | 158 | * Refresh the thresholds for each zone. |
159 | */ | 159 | */ |
160 | static void refresh_zone_stat_thresholds(void) | 160 | void refresh_zone_stat_thresholds(void) |
161 | { | 161 | { |
162 | struct zone *zone; | 162 | struct zone *zone; |
163 | int cpu; | 163 | int cpu; |
@@ -1201,7 +1201,6 @@ static int __init setup_vmstat(void) | |||
1201 | #ifdef CONFIG_SMP | 1201 | #ifdef CONFIG_SMP |
1202 | int cpu; | 1202 | int cpu; |
1203 | 1203 | ||
1204 | refresh_zone_stat_thresholds(); | ||
1205 | register_cpu_notifier(&vmstat_notifier); | 1204 | register_cpu_notifier(&vmstat_notifier); |
1206 | 1205 | ||
1207 | for_each_online_cpu(cpu) | 1206 | for_each_online_cpu(cpu) |