[LBo] About /proc/uptime [was: Chap 3 - Exercises]
Stefan Waidele
Stefan at Waidele.info
Mon Nov 13 21:14:28 CET 2006
Anita Lewis schrieb:
> [...]
> 'man proc' lists all those cute little files and somewhere in there is
> the part for uptime:
>
> /proc/uptime
> This file contains two numbers: the uptime of the system
> (sec‐
> onds), and the amount of time spent in idle process (seconds).
>
> And I don't know what idle process is, but I could see that it was not
> changing as I looked at the file off and on over time, while the first
> number did change as the seconds rolled by.
The "idle-process" is the process that runs when there is nothing to be
done. A CPU cannot do "nothing". Well, probably, it can (modern
power-management), but usually it needs to do stuff, and if it is only
to "go to the next command".
If there is no process requesting the CPU, then the idle-process is
being run.
So if the two numbers displayed by "cat /proc/uptime" are almost equal,
then your system is idle most of the time.
Anita's "idle-count" does not increase because she is running folding at
home at a very low priority. FaH _always_ has something to do, so on her
system, the idle-process is not being executed much. It is only run
when/if there is absolutely nothing to do and FaH needs to wait for some
I/O call to return...
Making sense?
Stefan
More information about the QnA
mailing list