Re: getloadavg and proc filesystem
- To: debian debian-isp <debian-isp@lists.debian.org>
- Subject: Re: getloadavg and proc filesystem
- From: Andrew Miehs <andrew@2sheds.de>
- Date: Mon, 20 Feb 2006 00:10:20 +0100
- Message-id: <[🔎] FB9FE05F-B5E2-4D9E-AA60-38832FE6EBEE@2sheds.de>
- In-reply-to: <200510051437.57567.aaryal@foresightint.com>
- References: <1ECEC78F-EC3F-44CA-9878-8248451131A5@2sheds.de> <200510041814.05055.aaryal@foresightint.com> <4958EAB2-32B3-429C-85F7-C206D195C3E1@2sheds.de> <200510051437.57567.aaryal@foresightint.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dear List,
I finally got around to asking the linux kernel mailing list about
reading from the proc filesystem, and reading /proc/stat
These are the two most interesting comments to note:
On Dec 5, 2005, at 4:58 PM, Bernd Eckenfels wrote:
...
the files in proc are all to some degree atomic to some not. You
will have
to look into the source for the specific file to see the details. For
smaller files if they fit into a single 4k page you have good chances.
Bigger files can cause all kind of trouble. (most often you miss new
records)
In case of stat the readings should be consistent within itself
since all
cpu lines fit into a single page.
...
and secondly regarding exactly on how to read /proc/stat
On Dec 7, 2005, at 4:12 PM, Rik van Riel wrote:
On Wed, 7 Dec 2005, Andrew Miehs wrote:
After reading your mail http://mail.nl.linux.org/linux-mm/2002-05/
msg00099.html regarding the implementation of iowait in /proc/
stat, I was wondering what the best method was to calculate iowait
statistics.
According to point 3...
3) iowait time is counted separately from user/system/idle and
can overlap with either system or idle (when no process is
running the system can still be busy processing interrupts)
is it correct to assume that
user + system + idle + nice + interrupts + iowait > 100% cputime
?
No, the total = 100%
Regards
Andrew
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
iD8DBQFD+PrdW126qUNSzvURAn0gAJ9NtunOccmQHTaM1eDNaSx5jX89VACdHYUp
zRRsuNmtNPZfecdRJ5NwJ4o=
=arTx
-----END PGP SIGNATURE-----
Reply to: