public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "David S. Ahern" <daahern@cisco.com>
To: Glauber Costa <gcosta@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm-devel <kvm@vger.kernel.org>
Subject: Re: kvm guest loops_per_jiffy miscalibration under host load
Date: Fri, 11 Jul 2008 15:18:54 -0600	[thread overview]
Message-ID: <4877CE3E.2060503@cisco.com> (raw)
In-Reply-To: <48728C38.9060303@redhat.com>

What's the status with this for full virt guests?

I am still seeing systematic time drifts in RHEL 3 and RHEL4 guests
which I've been digging into it the past few days. In the course of it I
have been launching guests with boosted priority (both nice -20 and
realtime priority (RR 1)) on a nearly 100% idle host.

One host is a PowerEdge 2950 running RHEL5.2 with kvm-70. With the
realtime priority boot I have routinely seen bogomips in the guest which
do not make sense. e.g.,

ksyms.2:bogomips        : 4639.94
ksyms.2:bogomips        : 4653.05
ksyms.2:bogomips        : 4653.05
ksyms.2:bogomips        : 24.52

and

ksyms.3:bogomips        : 4639.94
ksyms.3:bogomips        : 4653.05
ksyms.3:bogomips        : 16.33
ksyms.3:bogomips        : 12.87


Also, if I launch qemu with the "-no-kvm-pit -tdf" option the panic
guests panics with the message Marcelo posted at the start of the thread:

----

Calibrating delay loop... 4653.05 BogoMIPS

CPU: L2 cache: 2048K

Intel machine check reporting enabled on CPU#2.

CPU2: Intel QEMU Virtual CPU version 0.9.1 stepping 03

Booting processor 3/3 eip 2000

Initializing CPU#3

masked ExtINT on CPU#3

ESR value before enabling vector: 00000000

ESR value after enabling vector: 00000000

Calibrating delay loop... 19.60 BogoMIPS

CPU: L2 cache: 2048K

Intel machine check reporting enabled on CPU#3.

CPU3: Intel QEMU Virtual CPU version 0.9.1 stepping 03

Total of 4 processors activated (14031.20 BogoMIPS).

ENABLING IO-APIC IRQs

Setting 4 in the phys_id_present_map
...changing IO-APIC physical APIC ID to 4 ... ok.
..TIMER: vector=0x31 pin1=0 pin2=-1
..MP-BIOS bug: 8254 timer not connected to IO-APIC
...trying to set up timer (IRQ0) through the 8259A ...  failed.
...trying to set up timer as Virtual Wire IRQ... failed.
...trying to set up timer as ExtINT IRQ... failed :(.
Kernel panic: IO-APIC + timer doesn't work! pester mingo@redhat.com

----

I'm just looking for stable guest times. I'm not planning to keep the
boosted guest priority, just using it to ensure the guest is not
interrupted as I try to understand why the guest systematically drifts.

david


Glauber Costa wrote:
> Glauber Costa wrote:
>> On Mon, Jul 7, 2008 at 4:21 PM, Anthony Liguori <aliguori@us.ibm.com>
>> wrote:
>>> Marcelo Tosatti wrote:
>>>> On Mon, Jul 07, 2008 at 03:27:16PM -0300, Glauber Costa wrote:
>>>>
>>>>>> I agree.  A paravirt solution solves the problem.
>>>>>>
>>>>> Please, look at the patch I've attached.
>>>>>
>>>>> It does  __delay with host help. This may have the nice effect of not
>>>>> busy waiting for long-enough delays, and may well.
>>>>>
>>>>> It is _completely_ PoC, just to show the idea. It's ugly, broken,
>>>>> obviously have to go through pv-ops, etc.
>>>>>
>>>>> Also, I intend to add a lpj field in the kvm clock memory area. We
>>>>> could do just this later, do both, etc.
>>>>>
>>>>> If we agree this is a viable solution, I'll start working on a patch
>>>>>
>>>> This stops interrupts from being processed during the delay. And also
>>>> there are cases like this recently introduced break:
>>>>
>>>>                /* Allow RT tasks to run */
>>>>                preempt_enable();
>>>>                rep_nop();
>>>>                preempt_disable();
>>>>
>>>> I think it would be better to just pass the lpj value via paravirt and
>>>> let the guest busy-loop as usual.
>>>>
>>> I agree.  VMI and Xen already pass a cpu_khz paravirt value.  Something
>>> similar would probably do the trick.
>>
>> yeah, there is a pv-op for this, so I won't have to mess with the
>> clock interface. I'll draft a patch for it, and sent it.
>>
>>> It may be worthwhile having udelay() or spinlocks call into KVM if
>>> they've
>>> been spinning long enough but I think that's a separate discussion.
>>
>> I think it is, but I'd have to back it up with numbers. measurements
>> are on the way.
>>> Regards,
>>>
>>> Anthony Liguori
>>>
>>>
>>
>>
>>
> How about this? RFC only for now
> 

  reply	other threads:[~2008-07-11 21:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-02 16:40 kvm guest loops_per_jiffy miscalibration under host load Marcelo Tosatti
2008-07-03 13:17 ` Glauber Costa
2008-07-04 22:51   ` Marcelo Tosatti
2008-07-07  1:56   ` Anthony Liguori
2008-07-07 18:27     ` Glauber Costa
2008-07-07 18:48       ` Marcelo Tosatti
2008-07-07 19:21         ` Anthony Liguori
2008-07-07 19:32           ` Glauber Costa
2008-07-07 21:35             ` Glauber Costa
2008-07-11 21:18               ` David S. Ahern [this message]
2008-07-12 14:10                 ` Marcelo Tosatti
2008-07-12 19:28                   ` David S. Ahern
2008-07-07 18:17 ` Daniel P. Berrange
  -- strict thread matches above, loose matches on Subject: below --
2008-07-22  3:25 Marcelo Tosatti
2008-07-22  8:22 ` Jan Kiszka
2008-07-22 12:49   ` Marcelo Tosatti
2008-07-22 15:54     ` Jan Kiszka
2008-07-22 22:00     ` Dor Laor
2008-07-22 19:56 ` David S. Ahern
2008-07-23  2:57   ` David S. Ahern
2008-07-29 14:58   ` Marcelo Tosatti

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=4877CE3E.2060503@cisco.com \
    --to=daahern@cisco.com \
    --cc=gcosta@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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