]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sched: use for_each_cpu
authorAnton Blanchard <anton@samba.org>
Mon, 2 Aug 2004 03:09:24 +0000 (20:09 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 2 Aug 2004 03:09:24 +0000 (20:09 -0700)
The per cpu schedule counters need to be summed up over all possible cpus.
When testing hotplug cpu remove I saw the sum of the online cpu count for
nr_uninterruptible go negative which made the load average go nuts.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/sched.c

index c279ba2271454ce42cea2059916f8fa321fc46fe..3e88979199246bf0c45dd12fe62e4e7fe149e524 100644 (file)
@@ -1095,7 +1095,7 @@ unsigned long nr_uninterruptible(void)
 {
        unsigned long i, sum = 0;
 
-       for_each_online_cpu(i)
+       for_each_cpu(i)
                sum += cpu_rq(i)->nr_uninterruptible;
 
        return sum;
@@ -1105,7 +1105,7 @@ unsigned long long nr_context_switches(void)
 {
        unsigned long long i, sum = 0;
 
-       for_each_online_cpu(i)
+       for_each_cpu(i)
                sum += cpu_rq(i)->nr_switches;
 
        return sum;
@@ -1115,7 +1115,7 @@ unsigned long nr_iowait(void)
 {
        unsigned long i, sum = 0;
 
-       for_each_online_cpu(i)
+       for_each_cpu(i)
                sum += atomic_read(&cpu_rq(i)->nr_iowait);
 
        return sum;