[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: funny idle time from time



mdz@debian.org wrote:
>
> On Fri, Aug 31, 2001 at 02:37:17PM +1000, Brian May wrote:
> 
> > Top says on an completely idle system (well.. should be almost
> > completely idle):
> > [...]
> > CPU states:   0.2% user,  57.4% system,   0.8% nice,  41.6% idle
> > [...]
> >   PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
> >     3 root      19   0     0    0     0 SW   56.9  0.0   4:39 kapm-idled
> > [...]
> > I could make a few guesses at what is going on here (probably related to
> > the kapm-idled task, too), but first question: How does top calculate the
> > idle time?
> 
> Idle time is time in which the CPU is not executing any instructions.

The idle time (as reported by the kernel) is any time accounted to the
idle process (pid 0) which is not a visible process.

> kapm-idled executes HLT instructions to save power, so this time is not
> strictly idle, though it is time in which no user process or other kernel
> process is executing.

kapm-idled may do quite a lot more than just execute HLT instrutions
depending on how smart the BIOS is about saving power.  Unfortunately,
some BIOSs are pretty dumb and in some cases more power is consumed by
having CONFIG_APM_CPU_IDLE defined in your kernel build than by not.
If you can measure your CPU temperature, or power consumption, then
try it both ways and stick with the one that saves more power.

It is true that the time accounted to kapm-idled is "idle" time in
the sense that tere are NO other processes in the run queue when
kapm-idled is running (it checks).

Cheers,
Stephen Rothwell		Linux APM maintainer
IBM OzLabs - Linux Technology Centre



Reply to: