From: Nick Piggin read_page_state and __get_page_state only traverse online CPUs, which will cause results to fluctuate when CPUs are plugged in or out. Signed-off-by: Nick Piggin Cc: Hugh Dickins Signed-off-by: Andrew Morton --- mm/page_alloc.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff -puN mm/page_alloc.c~mm-page_state-fixes mm/page_alloc.c --- devel/mm/page_alloc.c~mm-page_state-fixes 2005-12-10 21:49:58.000000000 -0800 +++ devel-akpm/mm/page_alloc.c 2005-12-10 21:49:58.000000000 -0800 @@ -1170,12 +1170,11 @@ EXPORT_SYMBOL(nr_pagecache); DEFINE_PER_CPU(long, nr_pagecache_local) = 0; #endif -void __get_page_state(struct page_state *ret, int nr, cpumask_t *cpumask) +static void __get_page_state(struct page_state *ret, int nr, cpumask_t *cpumask) { int cpu = 0; memset(ret, 0, sizeof(*ret)); - cpus_and(*cpumask, *cpumask, cpu_online_map); cpu = first_cpu(*cpumask); while (cpu < NR_CPUS) { @@ -1228,7 +1227,7 @@ unsigned long __read_page_state(unsigned unsigned long ret = 0; int cpu; - for_each_online_cpu(cpu) { + for_each_cpu(cpu) { unsigned long in; in = (unsigned long)&per_cpu(page_states, cpu) + offset; _