/proc/stat idle count goes backwards in SMP

Lee Hetherington (ilh@lcs.mit.edu)
Wed, 21 Aug 1996 09:32:18 -0400


When running 2.0.13 SMP, I notice that vmstat's output is ridiculuous
for usr/sys/idl when we're effectively using more than one cpu. I've
traced this to the idle jiffy count in the first line of /proc/stat.
When heavily loaded, the idle count will go *down*. I didn't think that
was possible. The usr/sys counts always go up.

Further, the man page for proc says that the idle count should always be
100 times the second value in /proc/uptime. With SMP, the second value
is always zero for me. With UP, everything is correct.

What's going on?

Here is a snapshot of the first line of /proc/stat taken every second
while I was utilizing both cpus:

cpu 67578 1 779364 6400895
cpu 67605 1 779461 6400881
cpu 67644 1 779552 6400873
cpu 67715 1 779597 6400876
cpu 67746 1 779687 6400864
cpu 67776 1 779773 6400858
cpu 67798 1 779866 6400852

Note that this seems to happen when user+nice+sys > 100%.

Here is a snippet when the system was more or less idle:

cpu 74145 1 795433 6420079
cpu 74145 1 795434 6420189
cpu 74145 1 795435 6420295
cpu 74148 1 795443 6420393

Here is my /proc/uptime:

73129.29 0.00

Lee Hetherington
ilh@lcs.mit.edu