diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2007-07-16 02:39:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-16 12:05:41 -0400 |
commit | b4ef0296f214a1e0e65f161f88663b0ca1acca31 (patch) | |
tree | 57d0aa7e7201b6becf3bc69763e3efb090a297ce | |
parent | c67ad917cbf21b2862e2cf8e8b28339872ef7927 (diff) |
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>
-rw-r--r-- | lib/percpu_counter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c index 8901c4e9c2e6..cf22c617baa4 100644 --- a/lib/percpu_counter.c +++ b/lib/percpu_counter.c | |||
@@ -45,7 +45,7 @@ s64 percpu_counter_sum(struct percpu_counter *fbc) | |||
45 | 45 | ||
46 | spin_lock(&fbc->lock); | 46 | spin_lock(&fbc->lock); |
47 | ret = fbc->count; | 47 | ret = fbc->count; |
48 | for_each_possible_cpu(cpu) { | 48 | for_each_online_cpu(cpu) { |
49 | s32 *pcount = per_cpu_ptr(fbc->counters, cpu); | 49 | s32 *pcount = per_cpu_ptr(fbc->counters, cpu); |
50 | ret += *pcount; | 50 | ret += *pcount; |
51 | } | 51 | } |