From: Marcelo Tosatti <mtosatti@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Haozhong Zhang <haozhong.zhang@intel.com>,
kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
afaerber@suse.de, Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v2 0/3] target-i386: save/restore vcpu's TSC rate during migration
Date: Fri, 23 Oct 2015 08:35:20 -0200 [thread overview]
Message-ID: <20151023103517.GA24590@amt.cnet> (raw)
In-Reply-To: <20151022184521.GB3736@thinpad.lan.raisama.net>
On Thu, Oct 22, 2015 at 04:45:21PM -0200, Eduardo Habkost wrote:
> On Tue, Oct 20, 2015 at 03:22:51PM +0800, Haozhong Zhang wrote:
> > This patchset enables QEMU to save/restore vcpu's TSC rate during the
> > migration. When cooperating with KVM which supports TSC scaling, guest
> > programs can observe a consistent guest TSC rate even though they are
> > migrated among machines with different host TSC rates.
> >
> > A pair of cpu options 'save-tsc-freq' and 'load-tsc-freq' are added to
> > control the migration of vcpu's TSC rate.
>
> The requirements and goals aren't clear to me. I see two possible use
> cases, here:
>
> 1) Best effort to keep TSC frequency constant if possible (but not
> aborting migration if not possible). This would be an interesting
> default, but a bit unpredictable.
> 2) Strictly ensuring TSC frequency stays constant on migration (and
> aborting migration if not possible). This would be an useful feature,
> but can't be enabled by default unless both hosts have the same TSC
> frequency or support TSC scaling.
Only destination needs to support TSC scaling, to match the frequency
of the incoming host.
The KVM code for this feature has submitted or integrated?
> Which one(s) you are trying to implement?
>
> In other words, what is the right behavior when KVM_SET_TSC_KHZ fails or
> KVM_CAP_TSC_CONTROL is not available? We can't answer that question if
> the requirements and goals are not clear.
>
> Once we know what exactly is the goal, we could enable the new mode with
> a single option, instead of raw options to control migration stream
> loading/saving.
Windows and Linux guests have paravirt clocks and/or options to
disable direct TSC usage for timekeeping purposes. So disabling
migration seems overkill.
>
>
> > * By default, the migration of vcpu's TSC rate is enabled only on
> > pc-*-2.5 and newer machine types. If the cpu option 'save-tsc-freq'
> > is present, the vcpu's TSC rate will be migrated from older machine
> > types as well.
> > * Another cpu option 'load-tsc-freq' controls whether the migrated
> > vcpu's TSC rate is used. By default, QEMU will not use the migrated
> > TSC rate if this option is not present. Otherwise, QEMU will use
> > the migrated TSC rate and override the TSC rate given by the cpu
> > option 'tsc-freq'.
> >
> > Changes in v2:
> > * Add a pair of cpu options 'save-tsc-freq' and 'load-tsc-freq' to
> > control the migration of vcpu's TSC rate.
> > * Move all logic of setting TSC rate to target-i386.
> > * Remove the duplicated TSC setup in kvm_arch_init_vcpu().
> >
> > Haozhong Zhang (3):
> > target-i386: add a subsection for migrating vcpu's TSC rate
> > target-i386: calculate vcpu's TSC rate to be migrated
> > target-i386: load the migrated vcpu's TSC rate
> >
> > include/hw/i386/pc.h | 5 +++++
> > target-i386/cpu.c | 2 ++
> > target-i386/cpu.h | 3 +++
> > target-i386/kvm.c | 61 +++++++++++++++++++++++++++++++++++++++++++--------
> > target-i386/machine.c | 19 ++++++++++++++++
> > 5 files changed, 81 insertions(+), 9 deletions(-)
> >
> > --
> > 2.4.8
> >
>
> --
> Eduardo
next prev parent reply other threads:[~2015-10-23 10:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-20 7:22 [Qemu-devel] [PATCH v2 0/3] target-i386: save/restore vcpu's TSC rate during migration Haozhong Zhang
2015-10-20 7:22 ` [Qemu-devel] [PATCH v2 1/3] target-i386: add a subsection for migrating vcpu's TSC rate Haozhong Zhang
2015-10-20 7:22 ` [Qemu-devel] [PATCH v2 2/3] target-i386: calculate vcpu's TSC rate to be migrated Haozhong Zhang
2015-10-20 7:22 ` [Qemu-devel] [PATCH v2 3/3] target-i386: load the migrated vcpu's TSC rate Haozhong Zhang
2015-10-22 18:11 ` Eduardo Habkost
2015-10-23 3:04 ` Haozhong Zhang
2015-10-23 3:14 ` Haozhong Zhang
2015-10-23 14:58 ` Eduardo Habkost
2015-10-26 2:09 ` haozhong.zhang
2015-10-22 18:45 ` [Qemu-devel] [PATCH v2 0/3] target-i386: save/restore vcpu's TSC rate during migration Eduardo Habkost
2015-10-23 2:27 ` Haozhong Zhang
2015-10-23 14:45 ` Eduardo Habkost
2015-10-26 2:09 ` haozhong.zhang
2015-10-26 18:41 ` Eduardo Habkost
2015-10-27 1:09 ` haozhong.zhang
2015-10-23 10:35 ` Marcelo Tosatti [this message]
2015-10-23 12:22 ` Eduardo Habkost
2015-10-23 12:45 ` Haozhong Zhang
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=20151023103517.GA24590@amt.cnet \
--to=mtosatti@redhat.com \
--cc=afaerber@suse.de \
--cc=ehabkost@redhat.com \
--cc=haozhong.zhang@intel.com \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).