Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jan 2006 20:09:54 +0100
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Ian FREISLICH <if@hetzner.co.za>
Cc:        Alexander Leidinger <Alexander@Leidinger.net>, current@freebsd.org, arch@freebsd.org
Subject:   Re: [TEST/REVIEW] CPU accounting patches 
Message-ID:  <19559.1138216194@critter.freebsd.dk>
In-Reply-To: Your message of "Wed, 25 Jan 2006 15:09:20 %2B0200." <E1F1kOm-000FY2-8Z@hetzner.co.za> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <E1F1kOm-000FY2-8Z@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@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19559.1138216194>