From: Marcelo Tosatti <mtosatti@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Eduardo Habkost" <ehabkost@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>,
qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] invtsc + migration + TSC scaling
Date: Tue, 18 Oct 2016 15:09:26 -0200 [thread overview]
Message-ID: <20161018170924.GA14243@amt.cnet> (raw)
In-Reply-To: <74794dbf-a904-54b9-315f-1bc385a959ba@redhat.com>
On Tue, Oct 18, 2016 at 03:41:03PM +0200, Paolo Bonzini wrote:
>
>
> On 18/10/2016 01:58, Marcelo Tosatti wrote:
> > > We should also blacklist the TSC deadline timer when invtsc is not
> > > available.
> >
> > Actually, a nicer fix would be to check the different
> > frequencies and scale the deadline relative to the difference.
>
> You cannot know what exactly the guest was thinking when it set the TSC
> deadline. Perhaps it wanted an interrupt when the TSC was exactly
> 9876543210.
You can't expect the correlation between TSC value and timer interrupt
execution to be precise, because of the delay between HW timer
expiration and interrupt execution.
So you have to live with the fact that the TSC deadline timer can be
late (which is the same thing as with your paravirt solution, in case
of migration to host with faster TSC freq) (which to me renders the
argument above invalid).
Solution for old guests and new guests:
Just save how far ahead in the future the TSC deadline timer is supposed
to expire on the source (in ns), in the destination save all registers
(but disable TSC deadline timer injection), arm a timer in QEMU
for expiration time, reenable TSC deadline timer reinjection.
next prev parent reply other threads:[~2016-10-18 17:40 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-14 21:20 [Qemu-devel] invtsc + migration + TSC scaling Eduardo Habkost
2016-10-17 9:47 ` Marcelo Tosatti
2016-10-17 14:50 ` Radim Krčmář
2016-10-17 16:24 ` Paolo Bonzini
2016-10-17 21:11 ` Eduardo Habkost
2016-10-17 23:58 ` Marcelo Tosatti
2016-10-18 13:41 ` Paolo Bonzini
2016-10-18 17:09 ` Marcelo Tosatti [this message]
2016-10-18 20:52 ` Radim Krčmář
2016-10-18 21:05 ` Eduardo Habkost
2016-10-19 13:27 ` Radim Krčmář
2016-10-19 13:55 ` Eduardo Habkost
2016-10-19 15:42 ` Radim Krčmář
2016-10-19 17:42 ` Eduardo Habkost
2016-10-18 13:48 ` Radim Krčmář
2016-10-18 13:36 ` Radim Krčmář
2016-10-18 13:38 ` Radim Krčmář
2016-10-17 17:20 ` Marcelo Tosatti
2016-10-18 13:27 ` 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=20161018170924.GA14243@amt.cnet \
--to=mtosatti@redhat.com \
--cc=ehabkost@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).