aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/page_alloc.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 234bd4895d14..61775866ea18 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1214,24 +1214,22 @@ DEFINE_PER_CPU(long, nr_pagecache_local) = 0;
1214 1214
1215static void __get_page_state(struct page_state *ret, int nr, cpumask_t *cpumask) 1215static void __get_page_state(struct page_state *ret, int nr, cpumask_t *cpumask)
1216{ 1216{
1217 int cpu = 0; 1217 unsigned cpu;
1218 1218
1219 memset(ret, 0, nr * sizeof(unsigned long)); 1219 memset(ret, 0, nr * sizeof(unsigned long));
1220 cpus_and(*cpumask, *cpumask, cpu_online_map); 1220 cpus_and(*cpumask, *cpumask, cpu_online_map);
1221 1221
1222 cpu = first_cpu(*cpumask); 1222 for_each_cpu_mask(cpu, *cpumask) {
1223 while (cpu < NR_CPUS) { 1223 unsigned long *in;
1224 unsigned long *in, *out, off; 1224 unsigned long *out;
1225 1225 unsigned off;
1226 if (!cpu_isset(cpu, *cpumask)) 1226 unsigned next_cpu;
1227 continue;
1228 1227
1229 in = (unsigned long *)&per_cpu(page_states, cpu); 1228 in = (unsigned long *)&per_cpu(page_states, cpu);
1230 1229
1231 cpu = next_cpu(cpu, *cpumask); 1230 next_cpu = next_cpu(cpu, *cpumask);
1232 1231 if (likely(next_cpu < NR_CPUS))
1233 if (likely(cpu < NR_CPUS)) 1232 prefetch(&per_cpu(page_states, next_cpu));
1234 prefetch(&per_cpu(page_states, cpu));
1235 1233
1236 out = (unsigned long *)ret; 1234 out = (unsigned long *)ret;
1237 for (off = 0; off < nr; off++) 1235 for (off = 0; off < nr; off++)