Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Sep 2009 01:16:37 -0400 (EDT)
From:      Garrett Wollman <wollman@hergotha.csail.mit.edu>
To:        rysto32@gmail.com
Cc:        current@freebsd.org
Subject:   Re: FreeBSD timing issues and qemu (was: Re: [Qemu-devel] Re:  Breakage with local APIC routing)
Message-ID:  <200909080516.n885Gba0065213@hergotha.csail.mit.edu>
In-Reply-To: <bc2d970909071917n12256d9ucee24327aec3d527@mail.gmail.com>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
In article <bc2d970909071917n12256d9ucee24327aec3d527@mail.gmail.com>,
Ryan Stone  <rysto32@gmail.com> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909080516.n885Gba0065213>