From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpEfE-0002oJ-5b for qemu-devel@nongnu.org; Mon, 23 Jan 2012 02:50:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RpEfC-0007Pr-Lg for qemu-devel@nongnu.org; Mon, 23 Jan 2012 02:50:04 -0500 Received: from mail-ee0-f45.google.com ([74.125.83.45]:63771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpEfC-0007Pg-Gk for qemu-devel@nongnu.org; Mon, 23 Jan 2012 02:50:02 -0500 Received: by eekd17 with SMTP id d17so528012eek.4 for ; Sun, 22 Jan 2012 23:50:00 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4F1D1126.9010102@redhat.com> Date: Mon, 23 Jan 2012 08:49:58 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1327108107-16600-1-git-send-email-mdroth@linux.vnet.ibm.com> <1327166033-17922-1-git-send-email-mdroth@linux.vnet.ibm.com> <20120121203923.GE4871@jl-vm1.vm.bytemark.co.uk> <4F1CA602.2020103@linux.vnet.ibm.com> In-Reply-To: <4F1CA602.2020103@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] main-loop: For tools, initialize timers as part of qemu_init_main_loop() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: qemu-devel@nongnu.org On 01/23/2012 01:12 AM, Michael Roth wrote: > I'd looked into timer queues, which the developer docs suggested had > deprecated the use of mm timers, but I came across this which I figured > was why mm was preferred (%30 average error for a 50ms periodic/oneshot) > by the QEMU code: > > http://www.virtualdub.org/blog/pivot/entry.php?id=272 > > Apparently Windows 7 has some fixes for drift that makes them reasonable > for a clock source, but still fairly low-res for an event timer. On the other hand, timeBeginPeriod affect basically all time sources, not just MM timers. Using timer queues together with timeBeginPeriod might work, after all. However, it's not too interesting since timeBeginPeriod is what causes the additional CPU usage. What is interesting is to move timeBeginPeriod/timeEndPeriod from qemu-timer.c elsewhere so that only QEMU uses it. The tools do not need precise timekeeping anyway. But while that would be good to have later when more tools use the shared main loop, your patch is still good for now. Paolo