Commit f9d21ae7 authored by Anton Blanchard's avatar Anton Blanchard Committed by Linus Torvalds

[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: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f059989b
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment