From owner-freebsd-current@FreeBSD.ORG Tue Jan 24 22:45:16 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 83ECD16A41F; Tue, 24 Jan 2006 22:45:16 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDD7E43D6B; Tue, 24 Jan 2006 22:45:10 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 6883871 for multiple; Tue, 24 Jan 2006 17:44:54 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k0OMj6No016203; Tue, 24 Jan 2006 17:45:06 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: "Poul-Henning Kamp" Date: Tue, 24 Jan 2006 17:45:36 -0500 User-Agent: KMail/1.9.1 References: <24201.1138140983@critter.freebsd.dk> In-Reply-To: <24201.1138140983@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200601241745.38514.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1248/Tue Jan 24 05:54:38 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [TEST/REVIEW] CPU accounting patches X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2006 22:45:16 -0000 On Tuesday 24 January 2006 17:16, Poul-Henning Kamp wrote: > In message <200601241709.03450.jhb@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. Yeah, SIGINFO is an example, and getrusage() of another process might run into this, too. > I'd tend to say we should just forget about accounting for the > current quantum in that case. It was added to fix some of the "time going backwards" and "negative uptime" stuff I think. Ask Bruce. > 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. Unfortunately calcru() updates the millisecond counts (uu, su, iu) for running processes and I think having a bogus runtime gets that very confused. > Doing this may also simplify the locking of calcru ? Nah, it already runs lockless in some cases I think. > >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. Heh, I have one running head atm. However, it's second CPU is having issues (I think the CPU fan has died) so it's less useful than in the past. :( -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org