Re: top, ps etc. lying about cpu idle [was Re: Cyrix 6x86MX and , Centaur C6 CPUs in 2.1.102]

Rafael R. Reilova (rreilova@ececs.uc.edu)
Tue, 19 May 1998 11:06:33 -0500 (EST)


On Tue, 19 May 1998, Pavel Machek wrote:

> Hi!
>
> > ...and on an otherwise quiescent system the CPU is quite idle while doing
> > a kernel build, specially if you have slow disks like mine, and don't use
> > the "make -j" trick. On another VT I could see (using top) that the CPU
> > was idle between 15-95%, averaging around 60%.
>
> top is broken broken broken. I can make top see 95% idle while cpu is
> running at full tilt, and it happens pretty normally.
>
> TOP is lying about idle time - if you have short-lived processes, top
> will not see them (they are gone when it tries to look!) and top
> computes idle as 100%-other cpu time, which is broken broken broken.]

Ok, mentioning top wasn't the right thing. I should've mentioned also
that I was getting a consistent 25 sec system time reported, out the 7min
real time.

Still, what does the scheduler do when make,gcc,cc1,ld,as,etc does a sys
call to read from disk and every other process is blocked (nothing else to
schedule). I could be completely wrong, but doesn't it go to the idle
state, and uses the halt instruction until an interrupt comes along?
Since I'm doing make without the -j there should only be one of those
(make,gcc,etc) running a given time, everything else being blocked. If
there nothing else to schedule then the CPU should be doing a halt.
Correct?

Now, the purpose of my little bechmark was to test if there was a
performance penalty for enabling the suspend-on-halt of the 6x86MX (I
don't trust Cyrix docs). My results show that there is none. This is good
news for laptop users, they get the cake and eat it too.

Cheers,

--
Rafael

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu