From: Andrew Morton Date: Mon, 16 Jul 2007 06:39:51 +0000 (-0700) Subject: percpu_counters: use for_each_online_cpu() X-Git-Tag: v2.6.23-rc1~943 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=b4ef0296f214a1e0e65f161f88663b0ca1acca31;p=linux-2.6-omap-h63xx.git 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 Cc: Oleg Nesterov Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c index 8901c4e9c2e..cf22c617baa 100644 --- a/lib/percpu_counter.c +++ b/lib/percpu_counter.c @@ -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; }