Mailing List Archive


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

[tlug] Re: /proc/uptime



"Nguyen Vu Hung" <vuhung16plus@example.com> writes:

> What is the meaning of the second number( idle time) in the output of
> `cat /proc/uptime`?
> I really don't understand what is the "idle time" of the kernel.

I'm not sure since it's a long time since I was doing kernel stuff, but
here's my recollection.

When no normal task is scheduled the kernel runs the
init_task. This is a dummy task that is created before userspace is ever
entered. Nowadays, it does something like repeatedly call the ACPI
sleep hook.


[...]

>         cputime_t idletime = cputime_add(init_task.utime, init_task.stime);

This just adds up how much time (user + system) has been spent in the
init_task, so how much time has been spent with no actual task running.

[...]



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links