From: Akinobu Mita The number of times schedule() left the processor idle in the /proc/schedstat (runqueue.sched_goidle) seems to be wrong. The schedule() statistics should satisfy the equation: sched_cnt == sched_noswitch + sched_switch + sched_goidle (http://eaglet.rain.com/rick/linux/schedstat/v10/format-10.html) The below patch fix this, and I have confirmed to be fixed with: # grep ^cpu /proc/schedstat | awk '{print $6+$7+$9, $8}' Signed-off-by: Andrew Morton --- 25-sparc64-akpm/kernel/sched.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) diff -puN kernel/sched.c~schedstat-fix-schedule-statistics kernel/sched.c --- 25-sparc64/kernel/sched.c~schedstat-fix-schedule-statistics 2004-10-22 00:40:46.764681720 -0700 +++ 25-sparc64-akpm/kernel/sched.c 2004-10-22 00:40:46.771680656 -0700 @@ -2574,7 +2574,6 @@ go_idle: } } else { if (dependent_sleeper(cpu, rq)) { - schedstat_inc(rq, sched_goidle); next = rq->idle; goto switch_tasks; } @@ -2618,6 +2617,8 @@ go_idle: } next->activated = 0; switch_tasks: + if (next == rq->idle) + schedstat_inc(rq, sched_goidle); prefetch(next); clear_tsk_need_resched(prev); rcu_qsctr_inc(task_cpu(prev)); _