diff options
author | J. Bruce Fields <bfields@redhat.com> | 2010-09-20 07:48:00 +0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-09-20 07:48:32 +0400 |
commit | c88739b373e4930ed082a607cb78bf82616fd076 (patch) | |
tree | 251d969aa816dab5a62e6b36208b189b37de6534 /mm/vmstat.c | |
parent | 3211af1119174fbe8b676422b74870cdd51d7314 (diff) | |
parent | 827e3457022d0bb0b1bb8a0eb88501876fe7dcf0 (diff) | |
download | linux-c88739b373e4930ed082a607cb78bf82616fd076.tar.xz |
Merge remote branch 'trond/bugfixes' into for-2.6.37
Without some client-side fixes, server testing is currently difficult.
Diffstat (limited to 'mm/vmstat.c')
-rw-r--r-- | mm/vmstat.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c index f389168f9a83..355a9e669aaa 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -138,11 +138,24 @@ static void refresh_zone_stat_thresholds(void) int threshold; for_each_populated_zone(zone) { + unsigned long max_drift, tolerate_drift; + threshold = calculate_threshold(zone); for_each_online_cpu(cpu) per_cpu_ptr(zone->pageset, cpu)->stat_threshold = threshold; + + /* + * Only set percpu_drift_mark if there is a danger that + * NR_FREE_PAGES reports the low watermark is ok when in fact + * the min watermark could be breached by an allocation + */ + tolerate_drift = low_wmark_pages(zone) - min_wmark_pages(zone); + max_drift = num_online_cpus() * threshold; + if (max_drift > tolerate_drift) + zone->percpu_drift_mark = high_wmark_pages(zone) + + max_drift; } } @@ -813,7 +826,7 @@ static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat, "\n scanned %lu" "\n spanned %lu" "\n present %lu", - zone_page_state(zone, NR_FREE_PAGES), + zone_nr_free_pages(zone), min_wmark_pages(zone), low_wmark_pages(zone), high_wmark_pages(zone), @@ -998,6 +1011,7 @@ static int __cpuinit vmstat_cpuup_callback(struct notifier_block *nfb, switch (action) { case CPU_ONLINE: case CPU_ONLINE_FROZEN: + refresh_zone_stat_thresholds(); start_cpu_timer(cpu); node_set_state(cpu_to_node(cpu), N_CPU); break; |