From: Dor Laor <dlaor@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RESEND][PATCH 0/3] Fix guest time drift under heavy load.
Date: Wed, 05 Nov 2008 14:45:05 +0200 [thread overview]
Message-ID: <49119551.2070704@redhat.com> (raw)
In-Reply-To: <20081102130441.GD16809@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 4391 bytes --]
Gleb Natapov wrote:
> On Fri, Oct 31, 2008 at 02:17:19PM -0500, Anthony Liguori wrote:
>
>> Gleb Natapov wrote:
>>
>>> Qemu device emulation for timers might be inaccurate and
>>> causes coalescing of several IRQs into one. It happens when the
>>> load on the host is high and the guest did not manage to ack the
>>> previous IRQ. The problem can be reproduced by copying of a big
>>> file or many small ones inside Windows guest. When you do that guest
>>> clock start to lag behind the host one.
>>>
>>> The first patch in the series changes qemu_irq subsystem to return
>>> IRQ delivery status information. If device is notified that IRQs
>>> where lost it can regenerate them as needed. The following two
>>> patches add IRQ regeneration to PIC and RTC devices.
>>>
>>>
>> I don't think any of the problems raised when this was initially posted.
>>
> So? I raise them now. Have you tried suggested scenario and was able to
> reproduce the problem?
>
>
It is the same issue, just another scenario.
>> Further, I don't think that always playing catch-up with interrupts is
>> always the best course of action.
>>
>>
> Agree. Playing catch-up with interrupts is not always the best course of
> action. But sometimes there is no other choice.
>
>
>> As I've said repeatedly in the past, any sort of time drift fixes needs
>> to have a lot of data posted with it that is repeatable.
>>
>> How much does this improve things with Windows?
>>
> The time drift is eliminated. If there is a spike in a load time may
> slow down, but after that it catches up (this happens only during very
> high loads though).
>
>
Gleb, can you please provide more details:
- What's the host's kernel version exactly (including the high-res, dyn
tick configured)
- What's the windows version? Is it standard HAL (pit) or ACPI (rtc) or
both?
- The detailed scenario you use (example: I copied the entire c:/windows
directory, etc)
- Without the patch, what the time drift after x seconds on the host.
- With the patch, is there a drift? Is there increased cpu consumption, etc
Btw: I ack the whole thing, including the problem, the scenario and the
solution.
The first '1/3' was not received by my mailer.
>> How does having a high
>> resolution timer in the host affect the problem to begin with?
>>
> My test machine has relatively recent kernel that use high resolution
> timers for time keeping. Also the problem is that guest does not receive
> enough time to process injected interrupt. How hr timer can help here?
>
>
>> How do
>> Linux guests behave with this?
>>
> Linux guests don't use pit or RTC for time keeping. They are completely
> unaffected by those patches.
>
>
It will probably also drift with clock=pit in the guest kernel cmdline.
>> Even the Windows PV spec calls out three separate approaches to dealing
>> with missed interrupts and provides an interface for the host to query
>> the guest as to which one should be used. I don't think any solution
>> that uses a single technique is going to be correct.
>>
>>
> That is what I found in Microsoft docs:
>
> If a virtual processor is unavailable for a sufficiently long period of
> time, a full timer period may be missed. In this case, the hypervisor
> uses one of two techniques. The first technique involves timer period
> modulation, in effect shortening the period until the timer “catches
> up”.
>
> If a significant number of timer signals have been missed, the
> hypervisor may be unable to compensate by using period modulation. In
> this case, some timer expiration signals may be skipped completely.
> For timers that are marked as lazy, the hypervisor uses a second
> technique for dealing with the situation in which a virtual processor is
> unavailable for a long period of time. In this case, the timer signal is
> deferred until this virtual processor is available. If it doesn’t become
> available until shortly before the next timer is due to expire, it is
> skipped entirely.
>
> The first techniques is what I am trying to introduce with this patch
> series.
>
> --
> Gleb.
>
>
>
[-- Attachment #2: Type: text/html, Size: 5559 bytes --]
next prev parent reply other threads:[~2008-11-05 12:44 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-29 15:22 [Qemu-devel] [RESEND][PATCH 0/3] Fix guest time drift under heavy load Gleb Natapov
2008-10-29 15:22 ` [Qemu-devel] [PATCH 1/3] Change qemu_set_irq() to return status information Gleb Natapov
2008-10-29 15:22 ` [Qemu-devel] [PATCH 2/3] Fix time drift problem under high load when PIT is in use Gleb Natapov
2008-10-29 15:22 ` [Qemu-devel] [PATCH 3/3] Fix time drift problem under high load when RTC " Gleb Natapov
2008-11-05 12:46 ` Dor Laor
2008-10-31 19:17 ` [Qemu-devel] [RESEND][PATCH 0/3] Fix guest time drift under heavy load Anthony Liguori
2008-11-02 13:04 ` Gleb Natapov
2008-11-05 12:45 ` Dor Laor [this message]
2008-11-05 15:48 ` andrzej zaborowski
2008-11-05 16:33 ` Anthony Liguori
2008-11-06 7:16 ` Gleb Natapov
2008-11-06 9:37 ` andrzej zaborowski
2008-11-06 10:08 ` Gleb Natapov
2008-11-06 13:21 ` andrzej zaborowski
2008-11-06 14:18 ` Gleb Natapov
2008-11-06 14:35 ` andrzej zaborowski
2008-11-06 15:04 ` Gleb Natapov
2008-11-06 15:41 ` Anthony Liguori
2008-11-07 23:18 ` andrzej zaborowski
2008-11-08 8:23 ` Gleb Natapov
2008-11-06 13:44 ` Paul Brook
2008-11-05 17:43 ` Gleb Natapov
2008-11-06 17:28 ` David S. Ahern
2008-11-05 16:43 ` Anthony Liguori
2008-11-06 3:55 ` Jamie Lokier
2008-11-06 8:12 ` Gleb Natapov
2008-11-06 14:10 ` Anthony Liguori
2008-11-06 14:24 ` Paul Brook
2008-11-06 14:40 ` Anthony Liguori
2008-11-06 14:51 ` Gleb Natapov
2008-11-06 15:37 ` Anthony Liguori
2008-11-08 8:36 ` Gleb Natapov
2008-11-08 22:14 ` Dor Laor
2008-11-09 7:40 ` Gleb Natapov
2008-11-09 16:38 ` Anthony Liguori
2008-11-09 21:00 ` Avi Kivity
2008-11-09 16:36 ` Anthony Liguori
2008-11-10 14:37 ` Gleb Natapov
2008-11-10 15:24 ` Anthony Liguori
2008-11-10 15:29 ` Gleb Natapov
2008-11-10 15:46 ` Anthony Liguori
2008-11-10 15:51 ` Gleb Natapov
2008-11-11 14:43 ` Gleb Natapov
2008-11-11 17:26 ` Anthony Liguori
2008-11-11 20:17 ` Anthony Liguori
2008-11-12 11:42 ` Gleb Natapov
2008-11-12 11:54 ` Glauber Costa
2008-11-12 12:38 ` Dor Laor
2008-11-06 3:41 ` Jamie Lokier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49119551.2070704@redhat.com \
--to=dlaor@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).