All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Radim Krcmar <rkrcmar@redhat.com>, kvm list <kvm@vger.kernel.org>
Subject: Re: What's kvmclock's custom sched_clock for?
Date: Thu, 7 Jan 2016 08:59:32 -0200	[thread overview]
Message-ID: <20160107105932.GB6741@amt.cnet> (raw)
In-Reply-To: <CALCETrV2CSRntNHD79uq=vJjTOyN_pqvzrt+K7Hx=K7rdNf1CQ@mail.gmail.com>

On Thu, Jan 07, 2016 at 12:41:34AM -0800, Andy Lutomirski wrote:
> On Wed, Jan 6, 2016 at 11:18 PM, Andy Lutomirski <luto@amacapital.net> wrote:
> > AFAICT KVM reliably passes a monotonic TSC through to guests, even if
> > the host suspends.  That's all that sched_clock needs, I think.
> >
> > So why does kvmclock have a custom sched_clock?
> >
> > On a related note, KVM doesn't pass the "invariant TSC" feature
> > through to guests on my machine even though "invtsc" is set in QEMU
> > and the kernel host code appears to support it.  What gives?
> 
> I think I solved part of the puzzle.  KVM doesn't like to advertise
> invtsc by default because that breaks migration.  (Oddly, the end
> result seems wrong -- with migration, the TSC doesn't stop, but it's
> not constant, and X86_FEATURE_CONSTANT_TSC is nonetheless set, but
> whatever.)  So the scheduler clock doesn't get marked stable.

Can you break down this sentence?

QEMU commit 68bfd0ad4a1dcc4c328d5db85dc746b49c1ec07e

    target-i386: block migration and savevm if invariant tsc is exposed
    
    Invariant TSC documentation mentions that "invariant TSC will run at a
    constant rate in all ACPI P-, C-. and T-states".
    
    This is not the case if migration to a host with different TSC
frequency
    is allowed, or if savevm is performed. So block migration/savevm.


> Is that it?
> 
> This still doesn't explain why even explicitly trying to set invtsc
> doesn't seem to work.
> 
> --Andy

  reply	other threads:[~2016-01-07 11:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07  7:18 What's kvmclock's custom sched_clock for? Andy Lutomirski
2016-01-07  8:41 ` Andy Lutomirski
2016-01-07 10:59   ` Marcelo Tosatti [this message]
2016-01-07 15:18   ` Radim Krcmar
2016-01-07 17:27     ` Andy Lutomirski
2016-01-07 17:48       ` Radim Krcmar
2016-01-07 20:15       ` Marcelo Tosatti
2016-01-07 20:10     ` Marcelo Tosatti
2016-01-08 14:13       ` Radim Krcmar
2016-01-11 21:00         ` Marcelo Tosatti
2016-01-12 15:33           ` Radim Krcmar
2016-01-12 20:48             ` Marcelo Tosatti
2016-01-13 14:59               ` Radim Krcmar
2016-01-07 10:56 ` 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=20160107105932.GB6741@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=rkrcmar@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 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.