Re: [TEST/REVIEW] CPU accounting patches

From: Ian FREISLICH <if_at_hetzner.co.za>
Date: Wed, 25 Jan 2006 15:09:20 +0200
"Poul-Henning Kamp" wrote:
> In message <20060125114544.edawx42obkkos0ck_at_netchild.homeip.net>, Alexander L
ei
> dinger writes:
> 
> 
> >> That way, the user/system time reported will get units of "cpu seconds
> >> if the cpu ran full speed".
> >
> >How large do you expect the error will be?
> 
> I don't consider it an error, I consider it increasing precision.
> 
> 
> If you run
> 
> 	time mycommand
> 
> on your laptop, and along the way the CPU clock ramps up from
> 75 MHz to 600 MHz before it reports 
> 
> 	user 2.01  sys 0.30 real 4.00
> 
> What exactly have you learned from the first two numbers with the
> current definition of "cpu second" ?

"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?  It claims that user
and system time is is "the total amount of time spent executing in
user mode" and "the total amount of time spent in the system executing
on behalf of the process(es)".

> With my definition you would be more likely to see lower numbers
> maybe
> 	user 0.20  sys 0.03 real 4.00
> 
> And they would have meaning, they should be pretty much the same
> no matter what speed your CPU runs at any instant in time.

For how much of those 4 real seconds was the computer doing something
else using your definition?  It's certainly not 3.77.  It's probably
closer to 1.69.

> In theory, it should be possible to compare user/sys numbers
> you collect while running at 75 MHz with the ones you got
> under full steam at 1600 MHz.

If my CPU clock runs slower for a period of time, processes remain
on the CPU for longer.  I don't really see how 0.23 [wallclock]
seconds _if_ the cpu ran [at] full speed is different to 2.31
wallclock seconds in this context.  One is scaled to maximum CPU
clock frequency and the other is scaled to wallclock time.

I find the wallclock scale a bit less confusing because I normally
exist in that scale[1]: on my two hypothetical identical servers, one
clocked down to 50% for some reason, the same job takes twice the
wallclock time but identical CPU time?

Ian

--
Ian Freislich

1. It would be nice to say to my boss that this project would have
   taken a week if I'd worked faster and get a fat bonus because I
   could have done it faster.
Received on Wed Jan 25 2006 - 12:09:25 UTC

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