From owner-freebsd-arch@FreeBSD.ORG Tue May 29 21:38:36 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 7EA7D16A421 for ; Tue, 29 May 2007 21:38:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 0598D13C447 for ; Tue, 29 May 2007 21:38:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c211-30-225-63.carlnfd3.nsw.optusnet.com.au [211.30.225.63]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id l4TLcASW012615 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 30 May 2007 07:38:21 +1000 Date: Wed, 30 May 2007 07:38:11 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Julian Elischer In-Reply-To: <465C90F5.1000906@elischer.org> Message-ID: <20070530072219.G11288@besplex.bde.org> References: <20070529105856.L661@10.0.0.1> <200705291456.38515.jhb@freebsd.org> <20070529121653.P661@10.0.0.1> <465C90F5.1000906@elischer.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-arch@freebsd.org Subject: Re: rusage breakdown and cpu limits. 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: Tue, 29 May 2007 21:38:36 -0000 On Tue, 29 May 2007, Julian Elischer wrote: > Jeff Roberson wrote: >> I think I'm going to make the rusage struct per-thread and aggregate it on >> demand. There will be a lot of code churn, but it will be simple. There >> are a few cases where which will be complicated, and cpulimit is one of >> them. > > So, there should be somewhere to store the aggregated stats from threads that > have already exited. We already have that. It is the per-process rusage. There is already delayed accumulation for tick counts (these are currently accumulated in the rusage from the thread at context switch time). There is also delayed conversion of stats to the form needed by getrusage(). Stats are kept in raw form as long as possible (forever if nothing calls getrusage() or wait[34]() to look at them) to avoid conversion overhead for them on every exit(). So there are many precedents for delayed stats handling. Bruce