From owner-freebsd-current@FreeBSD.ORG Wed Jan 25 19:09:59 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 F1EC316A41F; Wed, 25 Jan 2006 19:09:58 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id 93D0043D46; Wed, 25 Jan 2006 19:09:57 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id B95B5BC74; Wed, 25 Jan 2006 19:09:54 +0000 (UTC) To: Ian FREISLICH From: "Poul-Henning Kamp" In-Reply-To: Your message of "Wed, 25 Jan 2006 15:09:20 +0200." Date: Wed, 25 Jan 2006 20:09:54 +0100 Message-ID: <19559.1138216194@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Alexander Leidinger , current@freebsd.org, 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: Wed, 25 Jan 2006 19:09:59 -0000 In message , Ian FREISLICH writes: >"One second's worth of the computer's processing time, which is >based on actual machine cycles used, not calendar time." ? > >Is the getrusage() manual page out of date? Yes. It was written before anybody had gotten the rather weird idea to have a CPU change frequency. Back then it was all about running as fast as possible all the time. We are therefore forced to try to divine the intent behind the text, and as somebody who were around back in the eighties I can testify that the intent was to be able to bill computer users for CPU instructions. Since the clock rate was constant, cpu seconds was a usable approximation. These days with variable clockrate, the cpu second is a bad approximation. If my CPU runs at 600MHz, even if used 100%, it can still do three times as much work, so the fact that my process takes 3 seconds to complete does not mean that I have used (in the sense of denying other users the ability to use) all of the CPU for three seconds. If I had monopolized the entire CPU to its fullest potential, it would have taken only one second. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@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.