From owner-freebsd-arch@FreeBSD.ORG Mon Jun 4 06:27:30 2007 Return-Path: X-Original-To: freebsd-arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4511116A46E for ; Mon, 4 Jun 2007 06:27:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail35.syd.optusnet.com.au (mail35.syd.optusnet.com.au [211.29.133.51]) by mx1.freebsd.org (Postfix) with ESMTP id D38F913C4AD for ; Mon, 4 Jun 2007 06:27:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c220-239-235-248.carlnfd3.nsw.optusnet.com.au [220.239.235.248]) by mail35.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id l546RIiB024194 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Jun 2007 16:27:19 +1000 Date: Mon, 4 Jun 2007 16:27:20 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jeff Roberson In-Reply-To: <20070601123530.B606@10.0.0.1> Message-ID: <20070604160036.N1084@besplex.bde.org> References: <20070529105856.L661@10.0.0.1> <200705291456.38515.jhb@freebsd.org> <20070529121653.P661@10.0.0.1> <20070530065423.H93410@delplex.bde.org> <20070529141342.D661@10.0.0.1> <20070530125553.G12128@besplex.bde.org> <20070529201255.X661@10.0.0.1> <20070529220936.W661@10.0.0.1> <20070530201618.T13220@besplex.bde.org> <20070530115752.F661@10.0.0.1> <20070531091419.S826@besplex.bde.org> <20070531010631.N661@10.0.0.1> <20070601154833.O4207@besplex.bde.org> <20070601014601.I799@10.0.0.1> <20070601200348.G6201@delplex.bde.org> <20070601123530.B606@10.0.0.1> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-arch@FreeBSD.org Subject: Re: Updated rusage patch X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2007 06:27:30 -0000 On Fri, 1 Jun 2007, Jeff Roberson wrote: > Please grep for statclock in threadlock.diff. This removes time_lock from > statclock all together and protects the whole thing with thread_lock(). With > this change all cpus can execute statclock() concurrently with sched_smp.c. > This patch also has fixes for locking ruxagg() as well as asserts. It does > not yet protect the ru copying in exit(). I want to figure out the > synchronization issues with wait first. I don't want to get involved reviewing another large[r] patch. A bug turned up with the previously committed patches: the swapper process is now shown as having a runtime of 40-47 seconds after booting (and never changes after that), but I don't use swapping and this process has always been shown as having a runtime of 0 seconds before. The bug seems to be that proc0_post() doesn't know anything about the rusage fields in the thread struct. Until recently, it was only missing initialization of td_*ticks. Now it is missing initialization of td_runtime too, so the bug is more obvious. The rusage fields may or may not be garbage when proc0_post() runs, depending on the details of clock initialization, so they are supposed to be cleared there. The runtime before clearing used to be complete garbage since timecounters were used for the runtime and the dummy timecounter gave garbage while booting. Now 47 seconds on one of my machines is larger than the real time between init386() and proc0_post() by a factor of about 5. Bruce