mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
cpu-load: standardize document format
Each text file under Documentation follows a different format. Some doesn't even have titles! Change its representation to follow the adopted standard, using ReST markups for it to be parseable by Sphinx: - mark literals; - Adjust document title; - Use a list for references. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
parent
f68ac62d11
commit
09338fb0f4
1 changed files with 59 additions and 58 deletions
|
@ -1,9 +1,10 @@
|
||||||
|
========
|
||||||
CPU load
|
CPU load
|
||||||
--------
|
========
|
||||||
|
|
||||||
Linux exports various bits of information via `/proc/stat' and
|
Linux exports various bits of information via ``/proc/stat`` and
|
||||||
`/proc/uptime' that userland tools, such as top(1), use to calculate
|
``/proc/uptime`` that userland tools, such as top(1), use to calculate
|
||||||
the average time system spent in a particular state, for example:
|
the average time system spent in a particular state, for example::
|
||||||
|
|
||||||
$ iostat
|
$ iostat
|
||||||
Linux 2.6.18.3-exp (linmac) 02/20/2007
|
Linux 2.6.18.3-exp (linmac) 02/20/2007
|
||||||
|
@ -17,7 +18,7 @@ Here the system thinks that over the default sampling period the
|
||||||
system spent 10.01% of the time doing work in user space, 2.92% in the
|
system spent 10.01% of the time doing work in user space, 2.92% in the
|
||||||
kernel, and was overall 81.63% of the time idle.
|
kernel, and was overall 81.63% of the time idle.
|
||||||
|
|
||||||
In most cases the `/proc/stat' information reflects the reality quite
|
In most cases the ``/proc/stat`` information reflects the reality quite
|
||||||
closely, however due to the nature of how/when the kernel collects
|
closely, however due to the nature of how/when the kernel collects
|
||||||
this data sometimes it can not be trusted at all.
|
this data sometimes it can not be trusted at all.
|
||||||
|
|
||||||
|
@ -33,7 +34,7 @@ Example
|
||||||
-------
|
-------
|
||||||
|
|
||||||
If we imagine the system with one task that periodically burns cycles
|
If we imagine the system with one task that periodically burns cycles
|
||||||
in the following manner:
|
in the following manner::
|
||||||
|
|
||||||
time line between two timer interrupts
|
time line between two timer interrupts
|
||||||
|--------------------------------------|
|
|--------------------------------------|
|
||||||
|
@ -43,12 +44,12 @@ in the following manner:
|
||||||
(only to be awaken quite soon)
|
(only to be awaken quite soon)
|
||||||
|
|
||||||
In the above situation the system will be 0% loaded according to the
|
In the above situation the system will be 0% loaded according to the
|
||||||
`/proc/stat' (since the timer interrupt will always happen when the
|
``/proc/stat`` (since the timer interrupt will always happen when the
|
||||||
system is executing the idle handler), but in reality the load is
|
system is executing the idle handler), but in reality the load is
|
||||||
closer to 99%.
|
closer to 99%.
|
||||||
|
|
||||||
One can imagine many more situations where this behavior of the kernel
|
One can imagine many more situations where this behavior of the kernel
|
||||||
will lead to quite erratic information inside `/proc/stat'.
|
will lead to quite erratic information inside ``/proc/stat``::
|
||||||
|
|
||||||
|
|
||||||
/* gcc -o hog smallhog.c */
|
/* gcc -o hog smallhog.c */
|
||||||
|
@ -103,8 +104,8 @@ int main (void)
|
||||||
References
|
References
|
||||||
----------
|
----------
|
||||||
|
|
||||||
http://lkml.org/lkml/2007/2/12/6
|
- http://lkml.org/lkml/2007/2/12/6
|
||||||
Documentation/filesystems/proc.txt (1.8)
|
- Documentation/filesystems/proc.txt (1.8)
|
||||||
|
|
||||||
|
|
||||||
Thanks
|
Thanks
|
||||||
|
|
Loading…
Add table
Reference in a new issue