From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MkqGw-0004YR-Ra for qemu-devel@nongnu.org; Mon, 07 Sep 2009 22:17:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MkqGs-0004V4-0K for qemu-devel@nongnu.org; Mon, 07 Sep 2009 22:17:30 -0400 Received: from [199.232.76.173] (port=49652 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MkqGr-0004Uo-Lc for qemu-devel@nongnu.org; Mon, 07 Sep 2009 22:17:25 -0400 Received: from mail-ew0-f223.google.com ([209.85.219.223]:36469) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MkqGr-00051d-63 for qemu-devel@nongnu.org; Mon, 07 Sep 2009 22:17:25 -0400 Received: by ewy23 with SMTP id 23so2689012ewy.8 for ; Mon, 07 Sep 2009 19:17:23 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20090907205955.GA91866@triton8.kn-bremen.de> 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> Date: Mon, 7 Sep 2009 22:17:23 -0400 Message-ID: Subject: Re: FreeBSD timing issues and qemu (was: Re: [Qemu-devel] Re: Breakage with local APIC routing) From: Ryan Stone Content-Type: multipart/alternative; boundary=00504502c8591d57bd0473079149 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juergen Lock Cc: Mohammed Gamal , freebsd-current@freebsd.org, Jan Kiszka , qemu-devel@nongnu.org, Avi Kivity --00504502c8591d57bd0473079149 Content-Type: text/plain; charset=ISO-8859-1 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. In any case, seeing interrupts come in at twice hz is expected behaviour. This means that the guest will be requesting a timer interrupt rate of twice the granularity that the host's scheduler can support; this may be the cause of your other timing problems(although I have a hard time imagining how). This timer is twice hz behaviour has existed at least since FreeBSD 6.1, so I can't explain why you see the new behaviour between 7 and 8. You do have hz set to 1000 on both the guest and host when running 7? * Actually, from looking at the code the behaviour is dynamic. If hz >= 1500, the timer interrupt rate is set to hz. If 750 <= hz < 1500, the timer interrupt rate is set to 2 * hz. If hz < 750, the timer interrupt rate is set to 4 * hz. --00504502c8591d57bd0473079149 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I'm not entirely clear on why it's done this way, but the timer is = run at twice hz for statistics-gathering purposes*.=A0 CPU usage statistics= gathering is driven off of the timer interrupt.=A0 Running the timer at tw= ice hz may be an attempt to eliminate clock-aliasing problems; if so, it= 9;s a poor way of doing so.=A0 In any case, seeing interrupts come in at tw= ice hz is expected behaviour.=A0 This means that the guest will be requesti= ng a timer interrupt rate of twice the granularity that the host's sche= duler can support; this may be the cause of your other timing problems(alth= ough I have a hard time imagining how).

This timer is twice hz behaviour has existed at least since FreeBSD 6.1= , so I can't explain why you see the new behaviour between 7 and 8.=A0 = You do have hz set to 1000 on both the guest and host when running 7?

* Actually, from looking at the code the behaviour is dynamic.=A0 If hz= >=3D 1500, the timer interrupt rate is set to hz.=A0 If 750 <=3D hz = < 1500, the timer interrupt rate is set to 2 * hz.=A0 If hz < 750, th= e timer interrupt rate is set to 4 * hz.
--00504502c8591d57bd0473079149--