Commit a6cccdc3 authored by KOSAKI Motohiro's avatar KOSAKI Motohiro Committed by Linus Torvalds

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: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Reviewed-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: default avatarMel Gorman <mel@csn.ul.ie>
Acked-by: default avatarChristoph Lameter <cl@linux.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1b79acc9
...@@ -261,6 +261,7 @@ extern void dec_zone_state(struct zone *, enum zone_stat_item); ...@@ -261,6 +261,7 @@ extern void dec_zone_state(struct zone *, enum zone_stat_item);
extern void __dec_zone_state(struct zone *, enum zone_stat_item); extern void __dec_zone_state(struct zone *, enum zone_stat_item);
void refresh_cpu_vm_stats(int); void refresh_cpu_vm_stats(int);
void refresh_zone_stat_thresholds(void);
int calculate_pressure_threshold(struct zone *zone); int calculate_pressure_threshold(struct zone *zone);
int calculate_normal_threshold(struct zone *zone); int calculate_normal_threshold(struct zone *zone);
...@@ -313,6 +314,8 @@ static inline void __dec_zone_page_state(struct page *page, ...@@ -313,6 +314,8 @@ static inline void __dec_zone_page_state(struct page *page,
#define set_pgdat_percpu_threshold(pgdat, callback) { } #define set_pgdat_percpu_threshold(pgdat, callback) { }
static inline void refresh_cpu_vm_stats(int cpu) { } static inline void refresh_cpu_vm_stats(int cpu) { }
static inline void refresh_zone_stat_thresholds(void) { }
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
extern const char * const vmstat_text[]; extern const char * const vmstat_text[];
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <linux/memory_hotplug.h> #include <linux/memory_hotplug.h>
#include <linux/nodemask.h> #include <linux/nodemask.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/vmstat.h>
#include <linux/mempolicy.h> #include <linux/mempolicy.h>
#include <linux/stop_machine.h> #include <linux/stop_machine.h>
#include <linux/sort.h> #include <linux/sort.h>
...@@ -5152,6 +5153,7 @@ int __meminit init_per_zone_wmark_min(void) ...@@ -5152,6 +5153,7 @@ int __meminit init_per_zone_wmark_min(void)
if (min_free_kbytes > 65536) if (min_free_kbytes > 65536)
min_free_kbytes = 65536; min_free_kbytes = 65536;
setup_per_zone_wmarks(); setup_per_zone_wmarks();
refresh_zone_stat_thresholds();
setup_per_zone_lowmem_reserve(); setup_per_zone_lowmem_reserve();
setup_per_zone_inactive_ratio(); setup_per_zone_inactive_ratio();
return 0; return 0;
......
...@@ -157,7 +157,7 @@ int calculate_normal_threshold(struct zone *zone) ...@@ -157,7 +157,7 @@ int calculate_normal_threshold(struct zone *zone)
/* /*
* Refresh the thresholds for each zone. * Refresh the thresholds for each zone.
*/ */
static void refresh_zone_stat_thresholds(void) void refresh_zone_stat_thresholds(void)
{ {
struct zone *zone; struct zone *zone;
int cpu; int cpu;
...@@ -1201,7 +1201,6 @@ static int __init setup_vmstat(void) ...@@ -1201,7 +1201,6 @@ static int __init setup_vmstat(void)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
int cpu; int cpu;
refresh_zone_stat_thresholds();
register_cpu_notifier(&vmstat_notifier); register_cpu_notifier(&vmstat_notifier);
for_each_online_cpu(cpu) for_each_online_cpu(cpu)
......
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