diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2012-11-27 23:29:04 -0200 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-11-27 23:29:15 -0200 |
commit | d98d07ca7e0347d712d54a865af323c4aee04bc2 (patch) | |
tree | 2de57537b6c789cb583262d381c92d2640defe0d /arch/x86/kvm | |
parent | b48aa97e38206a84bf8485e7c553412274708ce5 (diff) | |
download | linux-3.10-d98d07ca7e0347d712d54a865af323c4aee04bc2.tar.gz linux-3.10-d98d07ca7e0347d712d54a865af323c4aee04bc2.tar.bz2 linux-3.10-d98d07ca7e0347d712d54a865af323c4aee04bc2.zip |
KVM: x86: update pvclock area conditionally, on cpu migration
As requested by Glauber, do not update kvmclock area on vcpu->pcpu
migration, in case the host has stable TSC.
This is to reduce cacheline bouncing.
Acked-by: Glauber Costa <glommer@parallels.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/x86.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 422ef5ed219..fd766214d9d 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2627,7 +2627,12 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) kvm_x86_ops->write_tsc_offset(vcpu, offset); vcpu->arch.tsc_catchup = 1; } - kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu); + /* + * On a host with synchronized TSC, there is no need to update + * kvmclock on vcpu->cpu migration + */ + if (!vcpu->kvm->arch.use_master_clock || vcpu->cpu == -1) + kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu); if (vcpu->cpu != cpu) kvm_migrate_timers(vcpu); vcpu->cpu = cpu; |