All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, Wanpeng Li <kernellwp@gmail.com>
Cc: Sean Christopherson <sean.j.christopherson@intel.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH v4 1/2] KVM: X86: Less kvmclock sync induced vmexits after VM boots
Date: Tue, 18 Feb 2020 17:29:44 +0100	[thread overview]
Message-ID: <87mu9f97uv.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <e6caee13-f8f7-596c-fb37-6120e7c25f99@redhat.com>

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 18/02/20 15:54, Vitaly Kuznetsov wrote:
>>> -	schedule_delayed_work(&kvm->arch.kvmclock_sync_work,
>>> -					KVMCLOCK_SYNC_PERIOD);
>>> +	if (vcpu->vcpu_idx == 0)
>>> +		schedule_delayed_work(&kvm->arch.kvmclock_sync_work,
>>> +						KVMCLOCK_SYNC_PERIOD);
>>>  }
>>>  
>>>  void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
>> Forgive me my ignorance, I was under the impression
>> schedule_delayed_work() doesn't do anything if the work is already
>> queued (see queue_delayed_work_on()) and we seem to be scheduling the
>> same work (&kvm->arch.kvmclock_sync_work) which is per-kvm (not
>> per-vcpu).
>
> No, it executes after 5 minutes.  I agree that the patch shouldn't be
> really necessary, though you do save on cacheline bouncing due to
> test_and_set_bit.
>

True, but the changelog should probably be updated then.

-- 
Vitaly


  reply	other threads:[~2020-02-18 16:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18  1:17 [PATCH v4 1/2] KVM: X86: Less kvmclock sync induced vmexits after VM boots Wanpeng Li
2020-02-18  1:17 ` [PATCH RESEND v4 2/2] KVM: nVMX: Hold KVM's srcu lock when syncing vmcs12->shadow Wanpeng Li
2020-02-18 14:54 ` [PATCH v4 1/2] KVM: X86: Less kvmclock sync induced vmexits after VM boots Vitaly Kuznetsov
2020-02-18 15:33   ` Paolo Bonzini
2020-02-18 16:29     ` Vitaly Kuznetsov [this message]
2020-02-18 16:31       ` Paolo Bonzini
2020-02-19  0:32   ` Wanpeng Li

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=87mu9f97uv.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kernellwp@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=wanpengli@tencent.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 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.