From owner-freebsd-current@FreeBSD.ORG Tue Sep 8 05:43:16 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83ADA106566B for ; Tue, 8 Sep 2009 05:43:16 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Received: from hergotha.csail.mit.edu (hergotha.csail.mit.edu [66.92.79.170]) by mx1.freebsd.org (Postfix) with ESMTP id 269668FC0C for ; Tue, 8 Sep 2009 05:43:15 +0000 (UTC) Received: from hergotha.csail.mit.edu (localhost [127.0.0.1]) by hergotha.csail.mit.edu (8.14.2/8.14.2) with ESMTP id n885GbrJ065214; Tue, 8 Sep 2009 01:16:37 -0400 (EDT) (envelope-from wollman@hergotha.csail.mit.edu) Received: (from wollman@localhost) by hergotha.csail.mit.edu (8.14.2/8.13.8/Submit) id n885Gba0065213; Tue, 8 Sep 2009 01:16:37 -0400 (EDT) (envelope-from wollman) Date: Tue, 8 Sep 2009 01:16:37 -0400 (EDT) From: Garrett Wollman Message-Id: <200909080516.n885Gba0065213@hergotha.csail.mit.edu> To: rysto32@gmail.com X-Newsgroups: mit.lcs.mail.freebsd-current In-Reply-To: References: <4A93AFF9.1060201@web.de> <52d4a3890908250321u746e5757u136030bcbc19208d@mail.gmail.com> <4A93BF0C.8040601@web.de> <20090826221001.GA1070@triton8.kn-bremen.de> <4A96C8D9.6070804@web.de> <20090829211848.GA59305@triton8.kn-bremen.de> <4A9B800F.1040209@web.de> <20090831212723.GA32448@triton8.kn-bremen.de> <20090901201248.GA60123@triton8.kn-bremen.de> <20090907205955.GA91866@triton8.kn-bremen.de> Organization: None X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (hergotha.csail.mit.edu [127.0.0.1]); Tue, 08 Sep 2009 01:16:37 -0400 (EDT) X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=disabled version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hergotha.csail.mit.edu X-Mailman-Approved-At: Tue, 08 Sep 2009 13:43:03 +0000 Cc: current@freebsd.org Subject: Re: FreeBSD timing issues and qemu (was: Re: [Qemu-devel] Re: Breakage with local APIC routing) 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, 08 Sep 2009 05:43:16 -0000 In article , Ryan Stone wrote: >I'm not entirely clear on why it's done this way, but the timer is run at >twice hz for statistics-gathering purposes*. CPU usage statistics gathering >is driven off of the timer interrupt. Running the timer at twice hz may be >an attempt to eliminate clock-aliasing problems; if so, it's a poor way of >doing so. The statistics timer is supposed to be jittered with an exponential distribution, so that applications cannot avoid being charged for CPU time by running synchronously (and out-of-phase) with the timer. This was historically broken on PC hardware, and is probably still broken on SMP PC hardware, because there are insufficient programmable timer interrupts. Ideally, you'd like a distinct statistics timers on each CPU, with a sufficiently (quickly) programmable period. -GAWollman