public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Zachary Amsden <zamsden@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	Avi Kivity <avi@redhat.com>, kvm <kvm@vger.kernel.org>,
	Glauber Costa <glommer@redhat.com>
Subject: Re: [PATCH] fix kvmclock bug
Date: Sun, 26 Sep 2010 11:54:17 +0200	[thread overview]
Message-ID: <4C9F1849.1050801@web.de> (raw)
In-Reply-To: <4C9C5309.5080403@web.de>

[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]

Am 24.09.2010 09:28, Jan Kiszka wrote:
> Am 19.09.2010 02:15, Zachary Amsden wrote:
>> For CPUs with unstable TSC, we null time offset between not just VCPU
>> switches, but all preemptions of the kvm thread.  This makes a bug much
>> more likely where the kvmclock values are updated before a successful
>> exit from virt, causing an underflow.
>>
>> The null offsetting was added at : bf0fb4a42ba7eb362f4013bd2e93209666793e66
>> The underflow happens with this additional patch : 
>> cf839f5da2b0779b9ec8b990f851fb4e7d681da0
>>
>> There is a secondary bug, which is that TSC fails to advance with real
>> time on unstable TSC, but the fix is much more involved (it requires the
>> TSC catchup code).
>>
>> For now, this patch is sufficient to get things working again for me.
> 
> ...but not for me. I still face stuck (or infinitely slow) guests that
> want to use kvmclock once tsc_unstable gets set. Or is this patch
> addressing a different issue?

Commit bfb3f332 ("TSC catchup mode") in kvm.git finally resolves the
issue here.

That only leaves us with the likely wrong unstable declaration of the
TSC after resume. And that raises the question for me if KVM is actually
that much smarter than the Linux kernel in detecting TSC jumps. If
something is missing, can't we improve the kernel's detection mechanism
which already has suspend/resume support?

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

  reply	other threads:[~2010-09-26  9:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-19  0:15 [PATCH] fix kvmclock bug Zachary Amsden
2010-09-24  7:28 ` Jan Kiszka
2010-09-26  9:54   ` Jan Kiszka [this message]
2010-09-27 19:00     ` Zachary Amsden
2010-09-28  8:58       ` Jan Kiszka
2010-09-29  8:58 ` Avi Kivity

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=4C9F1849.1050801@web.de \
    --to=jan.kiszka@web.de \
    --cc=avi@redhat.com \
    --cc=glommer@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=zamsden@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