|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH] main-loop: For tools, initialize timers as part of qemu_init_main_loop() |
Date: | Mon, 23 Jan 2012 08:49:58 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |