Skip to content

Commit

Permalink
percpu_counters: use for_each_online_cpu()
Browse files Browse the repository at this point in the history
Now that we have implemented hotunplug-time counter spilling,
percpu_counter_sum() only needs to look at online CPUs.

Cc: Gautham R Shenoy <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
akpm00 authored and Linus Torvalds committed Jul 16, 2007
1 parent c67ad91 commit b4ef029
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/percpu_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b4ef029

Please sign in to comment.