All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: invtsc + migration + TSC scaling
Date: Tue, 18 Oct 2016 15:36:20 +0200	[thread overview]
Message-ID: <20161018133619.GB2205@potion> (raw)
In-Reply-To: <72b8c6b3-f08a-735a-e283-99d0195dcf7d@redhat.com>

2016-10-17 18:24+0200, Paolo Bonzini:
> On 17/10/2016 16:50, Radim Krčmář wrote:
>> 2016-10-17 07:47-0200, Marcelo Tosatti:
>>> On Fri, Oct 14, 2016 at 06:20:31PM -0300, Eduardo Habkost wrote:
>>>> I have been wondering: should we allow live migration with the
>>>> invtsc flag enabled, if TSC scaling is available on the
>>>> destination?
>>>
>>> TSC scaling and invtsc flag, yes.
>> 
>> Yes, if we have well synchronized time between hosts, then we might be
>> able to migrate with a TSC shift that cannot be perceived by the guest.
>> 
>> Unless the VM also has a migratable assigned PCI device that uses ART,
>> because we have no protocol to update the setting of ART (in CPUID), so
>> we should keep migration forbidden then.
> 
> We don't publish the ART leaf at all, do we?

Yes, it's a matter of time, though -- someone already asked for PTP in
guests, so we'll have to either provide a paravirtual host<->guest time
synchronization protocol that shares PTP from the host or let them use
assigned devices ...

>>> 1) Migration: to host with different TSC frequency.
>> 
>> We shouldn't have done this even now when emulating anything newer than
>> Pentium 4, because those CPUs have constant TSC, which only lacks the
>> guarantee that it doesn't stop in deep C-states:
> 
> Right, but:
> 
>>> since Linux guests use kvmclock and Windows guests use Hyper-V
>>> enlightenment, it should be fine to disable 2).
> 
> ... and 1 too.

Yes.  We could stop exposing TSC then, because it should have no direct
users -- kvmclock can work even if TSC is not in CPUID, because we
paravirtualize it.

> We should also blacklist the TSC deadline timer when invtsc is not
> available.

True.

I was thinking that with Wanpeng's VMX preemption patches, we might not
need the TSC nor paravirtual deadline timer, the because performance of
LAPIC one-shot could be very similar.

WARNING: multiple messages have this Message-ID (diff)
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] invtsc + migration + TSC scaling
Date: Tue, 18 Oct 2016 15:36:20 +0200	[thread overview]
Message-ID: <20161018133619.GB2205@potion> (raw)
In-Reply-To: <72b8c6b3-f08a-735a-e283-99d0195dcf7d@redhat.com>

2016-10-17 18:24+0200, Paolo Bonzini:
> On 17/10/2016 16:50, Radim Krčmář wrote:
>> 2016-10-17 07:47-0200, Marcelo Tosatti:
>>> On Fri, Oct 14, 2016 at 06:20:31PM -0300, Eduardo Habkost wrote:
>>>> I have been wondering: should we allow live migration with the
>>>> invtsc flag enabled, if TSC scaling is available on the
>>>> destination?
>>>
>>> TSC scaling and invtsc flag, yes.
>> 
>> Yes, if we have well synchronized time between hosts, then we might be
>> able to migrate with a TSC shift that cannot be perceived by the guest.
>> 
>> Unless the VM also has a migratable assigned PCI device that uses ART,
>> because we have no protocol to update the setting of ART (in CPUID), so
>> we should keep migration forbidden then.
> 
> We don't publish the ART leaf at all, do we?

Yes, it's a matter of time, though -- someone already asked for PTP in
guests, so we'll have to either provide a paravirtual host<->guest time
synchronization protocol that shares PTP from the host or let them use
assigned devices ...

>>> 1) Migration: to host with different TSC frequency.
>> 
>> We shouldn't have done this even now when emulating anything newer than
>> Pentium 4, because those CPUs have constant TSC, which only lacks the
>> guarantee that it doesn't stop in deep C-states:
> 
> Right, but:
> 
>>> since Linux guests use kvmclock and Windows guests use Hyper-V
>>> enlightenment, it should be fine to disable 2).
> 
> ... and 1 too.

Yes.  We could stop exposing TSC then, because it should have no direct
users -- kvmclock can work even if TSC is not in CPUID, because we
paravirtualize it.

> We should also blacklist the TSC deadline timer when invtsc is not
> available.

True.

I was thinking that with Wanpeng's VMX preemption patches, we might not
need the TSC nor paravirtual deadline timer, the because performance of
LAPIC one-shot could be very similar.

  parent reply	other threads:[~2016-10-18 13:36 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-14 21:20 invtsc + migration + TSC scaling Eduardo Habkost
2016-10-14 21:20 ` [Qemu-devel] " Eduardo Habkost
2016-10-17  9:47 ` Marcelo Tosatti
2016-10-17  9:47   ` [Qemu-devel] " Marcelo Tosatti
2016-10-17 14:50   ` Radim Krčmář
2016-10-17 14:50     ` [Qemu-devel] " Radim Krčmář
2016-10-17 16:24     ` Paolo Bonzini
2016-10-17 16:24       ` [Qemu-devel] " Paolo Bonzini
2016-10-17 21:11       ` Eduardo Habkost
2016-10-17 21:11         ` [Qemu-devel] " Eduardo Habkost
2016-10-17 23:58         ` Marcelo Tosatti
2016-10-17 23:58           ` [Qemu-devel] " Marcelo Tosatti
2016-10-18 13:41           ` Paolo Bonzini
2016-10-18 13:41             ` [Qemu-devel] " Paolo Bonzini
2016-10-18 17:09             ` Marcelo Tosatti
2016-10-18 17:09               ` [Qemu-devel] " Marcelo Tosatti
2016-10-18 20:52               ` Radim Krčmář
2016-10-18 20:52                 ` [Qemu-devel] " Radim Krčmář
2016-10-18 21:05                 ` Eduardo Habkost
2016-10-18 21:05                   ` [Qemu-devel] " Eduardo Habkost
2016-10-19 13:27                   ` Radim Krčmář
2016-10-19 13:27                     ` [Qemu-devel] " Radim Krčmář
2016-10-19 13:55                     ` Eduardo Habkost
2016-10-19 13:55                       ` [Qemu-devel] " Eduardo Habkost
2016-10-19 15:42                       ` Radim Krčmář
2016-10-19 15:42                         ` [Qemu-devel] " Radim Krčmář
2016-10-19 17:42                         ` Eduardo Habkost
2016-10-19 17:42                           ` [Qemu-devel] " Eduardo Habkost
2016-10-18 13:48           ` Radim Krčmář
2016-10-18 13:48             ` [Qemu-devel] " Radim Krčmář
2016-10-18 13:36       ` Radim Krčmář [this message]
2016-10-18 13:36         ` Radim Krčmář
2016-10-18 13:38         ` Radim Krčmář
2016-10-18 13:38           ` [Qemu-devel] " Radim Krčmář
2016-10-17 17:20     ` Marcelo Tosatti
2016-10-17 17:20       ` [Qemu-devel] " Marcelo Tosatti
2016-10-18 13:27       ` Radim Krčmář
2016-10-18 13:27         ` [Qemu-devel] " Radim Krčmář
2016-10-18  9:04     ` Dr. David Alan Gilbert

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=20161018133619.GB2205@potion \
    --to=rkrcmar@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@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 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.