Re: [TEST/REVIEW] CPU accounting patches

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Tue, 24 Jan 2006 23:16:23 +0100
In message <200601241709.03450.jhb_at_freebsd.org>, John Baldwin writes:
>On Tuesday 24 January 2006 16:10, Poul-Henning Kamp wrote:
>> Here is a new version of my cpu accounting change patch.
>>

>The XXX in calcru1() you can remove.  The rux you are adding the current time 
>to is a local rusage_ext on the stack.

I found that out myself and forgot to remove the XXX :-)

>However, your changes probably make 
>it bogus in that the current code assumes it can subtract the start time of 
>another CPU (for a thread running on another CPU) from the current time on 
>this CPU to get the amount of time the other thread has been running on the 
>other CPU since it last updated p->p_rux.rux_runtime.

This is when we call calcru on a running process ?

Yeah, that's a problem.

I'd tend to say we should just forget about accounting for the
current quantum in that case.

This is a valid handling IMO because the result can never be used
in any final or definitive kind of way anyway.  When the process
finishes or deschedules the numbers will get updated correctly.

Doing this may also simplify the locking of calcru ?

>Other than that this patch looks fine to me.  FYI, Alpha also has a per-cpu 
>counter (RPCC) that is used for the timecounter on UP Alphas.

My Alpha is hosed right now and doesn't want to boot 6.0-R.  I havn't had
time to boot my 5.0-R on it and do the upgrade to -current the long way.

-- 
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 Tue Jan 24 2006 - 21:16:29 UTC

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