All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] QEMU on windows timing problems
@ 2007-06-21 16:07 Daniel Ionita
  2007-06-21 20:20 ` Dor Laor
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Ionita @ 2007-06-21 16:07 UTC (permalink / raw)
  To: qemu-devel


Hello.

I have a problem with time drifting inside the QEMU machine (running
XP SP2). This is more visible as the load inside the VM increases
(heavy hard-disk activity, almost 100% CPU usage). However, I need to
control some actions inside the VM machine which depend on time. Any
idea how I can increase QEMU's time resolution, to make it more exact?

I need something on the order of seconds. For example, on the latest
tests that I've done, in a total run of 7 minutes QEMU's clock lagged
by 4 minutes (so it's ~50% slower than real time).

Host machine x86, Windows, with kqemu installed. I mention that the
problem is much worse when I run QEMU in a SMP environment, but it is
fixable by setting process affinity to specific CPUs.

Thanks a lot.

-- 
Best regards,
 Daniel                          mailto:dionita@bitdefender.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [Qemu-devel] QEMU on windows timing problems
  2007-06-21 16:07 [Qemu-devel] QEMU on windows timing problems Daniel Ionita
@ 2007-06-21 20:20 ` Dor Laor
  0 siblings, 0 replies; 2+ messages in thread
From: Dor Laor @ 2007-06-21 20:20 UTC (permalink / raw)
  To: Daniel Ionita, qemu-devel


>Hello.
>
>I have a problem with time drifting inside the QEMU machine (running
>XP SP2). This is more visible as the load inside the VM increases
>(heavy hard-disk activity, almost 100% CPU usage). However, I need to
>control some actions inside the VM machine which depend on time. Any
>idea how I can increase QEMU's time resolution, to make it more exact?
>
>I need something on the order of seconds. For example, on the latest
>tests that I've done, in a total run of 7 minutes QEMU's clock lagged
>by 4 minutes (so it's ~50% slower than real time).
>
>Host machine x86, Windows, with kqemu installed. I mention that the
>problem is much worse when I run QEMU in a SMP environment, but it is
>fixable by setting process affinity to specific CPUs.
>

I checked the problem with/without KVM and got identical results.
The problem source is that qemu relays on SIGALARM for qemu - timer, not
only the signal does not arrive on time, several signals may unit.
Relaying on PIT source clock makes the problem worse because several PIT
interrupts might got unified too.

Solutions:
- (Works foe second granularity) Use dyn-tick enabled kernel (the latest
i386 kernel or patched 2.6.22 for 64 bit).
- (Simple, not elegant workaround) Measure the PIT frequency and make
sure that X PIT irqs are acknowledged 
- (best solution) Use dyn-tick kernel + implement qemu dyn-tick timer.
HTH, 	Dor.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-06-21 20:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-21 16:07 [Qemu-devel] QEMU on windows timing problems Daniel Ionita
2007-06-21 20:20 ` Dor Laor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.