diff options
author | Anton Blanchard <anton@samba.org> | 2004-08-01 20:09:24 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-08-01 20:09:24 -0700 |
commit | f9d21ae77239647093e15c0239dd9c381cd090a8 (patch) | |
tree | 1a0a52fe675855c15a5be6dae157abd4d2a2d0e1 /kernel | |
parent | f059989bca20a55ccfc4bc8b9283e837874e605c (diff) | |
download | history-f9d21ae77239647093e15c0239dd9c381cd090a8.tar.gz |
[PATCH] sched: use for_each_cpu
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index c279ba2271454c..3e88979199246b 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -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; |