Commit b4ef0296f214a1e0e65f161f88663b0ca1acca31

Authored by Andrew Morton
Committed by Linus Torvalds
1 parent c67ad917cb

percpu_counters: use for_each_online_cpu()

Now that we have implemented hotunplug-time counter spilling,
percpu_counter_sum() only needs to look at online CPUs.

Cc: Gautham R Shenoy <ego@in.ibm.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

lib/percpu_counter.c
... ... @@ -45,7 +45,7 @@
45 45  
46 46 spin_lock(&fbc->lock);
47 47 ret = fbc->count;
48   - for_each_possible_cpu(cpu) {
  48 + for_each_online_cpu(cpu) {
49 49 s32 *pcount = per_cpu_ptr(fbc->counters, cpu);
50 50 ret += *pcount;
51 51 }