public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Zachary Amsden <zamsden@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>, kvm <kvm@vger.kernel.org>
Subject: Re: KVM: Remaining body of TSC emulation work
Date: Tue, 21 Jun 2011 05:21:02 -0700	[thread overview]
Message-ID: <4E008CAE.9020406@redhat.com> (raw)
In-Reply-To: <4E005B5B.7090401@siemens.com>

On 06/21/2011 01:50 AM, Jan Kiszka wrote:
> On 2011-06-21 01:59, Zachary Amsden wrote:
>    
>> In-Reply-To:
>>
>> This is the remaining bulk of work I have related to TSC emulation.
>> In summary, I believe this fixes all known issues with TSC.  A few
>> rather subtle issues are cleaned up, S4 suspend is fixed, and the
>> API for adjust_tsc_offset is expanded to take arguments in either
>> guest cycles or optionally host cycles.  The final patch adds
>> software TSC emulation, with a configurable default setting.
>>
>> Note that TSC trapping will only be used when other methods fail
>> due to unstable TSC or lack of scaling hardware.  With the improved
>> offset matching, I was even able to get SMP guests to boot with a
>> TSC clock; cycle testing showed a maximum backwards leap of around
>> 0.25 ms, which is actually fairly good.  With the last patch applied,
>> software TSC emulation kicks in and the backwards TSC count even on
>> my broken hardware dropped to zero.
>>
>> Some of this code (the S4 suspend compensation) has already been
>> ported into RHEL to fix various bugs - however upstream had diverged
>> a bit from the original course I planned; I had to add a few things
>> that had been optimized out of upstream back in (last_host_tsc).
>>
>> In the course of doing this, I think the new code looks much
>> cleaner, with well documented and easy to understand variables.
>> Yes, there are a lot of tracking variables to maintain this whole
>> infrastructure - and yes, some of them appear to be redundant of
>> easily computable from others - but in actuality, the information
>> they provide is easy to understand, and the resulting code is much
>> easier to verify than a complex system where some quantities may
>> be undefined or computed on the fly and thus causing subtle races.
>>
>> Zach
>>
>>      
> You want this to show up on kvm@vger.kernel.org as well, no? :)
>    

Yeah, oops on that.

> Looks like there is still mark_tsc_unstable in KVM code, so we aren't
> yet at the point of ultimate cleanness. Nevertheless, we see that I'll
> test suspend to RAM with this soon.
>    

Yeah, I decided not to remove it... should it fire, we've detected 
either a bad hardware TSC or some previously unseen platform behavior.  
We're obligated to report it, and if it turns out to be another issue 
like suspend to RAM, we now have the machinery to fix it.

Zach

           reply	other threads:[~2011-06-21 12:21 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <4E005B5B.7090401@siemens.com>]

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=4E008CAE.9020406@redhat.com \
    --to=zamsden@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.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