From owner-freebsd-current@FreeBSD.ORG Tue Sep 8 02:17:26 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4A98106566B for ; Tue, 8 Sep 2009 02:17:24 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by mx1.freebsd.org (Postfix) with ESMTP id 427168FC13 for ; Tue, 8 Sep 2009 02:17:24 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 4so1467902eyf.9 for ; Mon, 07 Sep 2009 19:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=QKVS75gDVgBiEky+47WuUYfJJGgDMC293DOlXjOXKlQ=; b=t7bp3HZJppyiSHHvrf0GfpUVlBvHzPKHHeYPfWX6AzGApsr4dxI4gAWMut1Zgdx+eR KWfPsK4YXvhYs6SvUnBQL45olL3Xze9bimJmt1NJBbRKpnnl9bFIajjE9CpeZanQmsEo A6Acp2qboD7mxQtB8MI3oXUGHcAzqtDb3Sj50= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=YQH1BLjlu/b6/h154o8zJzxoRFwUNJ/B4/g0xteeP+PC8uwKwrUdJPlifKR9PYr5Vk d7t7KFwnAWIplkgvVVECTTMAV9aujUD3MiVcVpITPt5NDUU9GqhShLNI1jbbsE7LTuw5 eQqfpp1VPxsk5DKV1XexvQlMfvE8w1IlUubJQ= MIME-Version: 1.0 Received: by 10.211.154.7 with SMTP id g7mr16971910ebo.10.1252376243426; Mon, 07 Sep 2009 19:17:23 -0700 (PDT) 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: From: Ryan Stone To: Juergen Lock Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Mohammed Gamal , freebsd-current@freebsd.org, Jan Kiszka , qemu-devel@nongnu.org, Avi Kivity 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 02:17:26 -0000 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.