Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jan 2006 17:09:01 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-arch@freebsd.org
Cc:        Poul-Henning Kamp <phk@phk.freebsd.dk>, current@freebsd.org
Subject:   Re: [TEST/REVIEW] CPU accounting patches
Message-ID:  <200601241709.03450.jhb@freebsd.org>
In-Reply-To: <23570.1138137045@critter.freebsd.dk>
References:  <23570.1138137045@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 24 January 2006 16:10, Poul-Henning Kamp wrote:
> Here is a new version of my cpu accounting change patch.
>
> 	http://phk.freebsd.dk/patch/cpu_acct_1.patch
>
> This patch is supposedly harmless (or at least mostly harmless)
> and I'd appreciate it getting a solid trashing.

The XXX in calcru1() you can remove.  The rux you are adding the current time 
to is a local rusage_ext on the stack.  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.  However, with the CPUs 
having disparate timings this would break as curthread's CPU's notion of now 
will be unrelated to the other thread's CPU's notion of now.

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.

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



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