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>
This commit is contained in:
Andrew Morton 2007-07-15 23:39:51 -07:00 committed by Linus Torvalds
parent c67ad917cb
commit b4ef0296f2
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ s64 percpu_counter_sum(struct percpu_counter *fbc)
spin_lock(&fbc->lock);
ret = fbc->count;
for_each_possible_cpu(cpu) {
for_each_online_cpu(cpu) {
s32 *pcount = per_cpu_ptr(fbc->counters, cpu);
ret += *pcount;
}