Re: [TEST/REVIEW] CPU accounting patches

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Wed, 25 Jan 2006 20:09:54 +0100
In message <E1F1kOm-000FY2-8Z_at_hetzner.co.za>, Ian FREISLICH writes:

>"One second's worth of the computer's processing time, which is
>based on actual machine cycles used, not calendar time." ?
>
>Is the getrusage() manual page out of date?

Yes.

It was written before anybody had gotten the rather weird idea to
have a CPU change frequency.  Back then it was all about running
as fast as possible all the time.

We are therefore forced to try to divine the intent behind the text,
and as somebody who were around back in the eighties I can testify
that the intent was to be able to bill computer users for CPU
instructions.

Since the clock rate was constant, cpu seconds was a usable
approximation.

These days with variable clockrate, the cpu second is a bad approximation.
If my CPU runs at 600MHz, even if used 100%, it can still do three times
as much work, so the fact that my process takes 3 seconds to complete
does not mean that I have used (in the sense of denying other users the
ability to use) all of the CPU for three seconds.  If I had monopolized
the entire CPU to its fullest potential, it would have taken only one
second.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk_at_FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
Received on Wed Jan 25 2006 - 18:09:59 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:51 UTC