Re: [PATCH v3] KVM: X86: Just one leader to trigger kvmclock sync request

From: Paolo Bonzini
Date: Mon Mar 02 2020 - 13:22:15 EST


On 02/03/20 14:01, Vitaly Kuznetsov wrote:
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -9389,11 +9389,9 @@ void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
>
> mutex_unlock(&vcpu->mutex);
>
> - if (!kvmclock_periodic_sync)
> - return;
> -
> - schedule_delayed_work(&kvm->arch.kvmclock_sync_work,
> - KVMCLOCK_SYNC_PERIOD);
> + if (vcpu->vcpu_idx == 0 && kvmclock_periodic_sync)
> + schedule_delayed_work(&kvm->arch.kvmclock_sync_work,
> + KVMCLOCK_SYNC_PERIOD);
> }

> Reviewed-by: Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>

Good idea, I squashed the change.

Paolo