All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Wanpeng Li <wanpeng.li@hotmail.com>
Cc: David Matlack <dmatlack@google.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7 1/3] KVM: make halt_poll_ns per-vCPU
Date: Sun, 6 Sep 2015 16:33:52 +0200	[thread overview]
Message-ID: <55EC4ED0.90703@redhat.com> (raw)
In-Reply-To: <BLU436-SMTP201BF939A6C9DAB38BCCC1B80570@phx.gbl>



On 03/09/2015 16:07, Wanpeng Li wrote:
> Change halt_poll_ns into per-VCPU variable, seeded from module parameter,
> to allow greater flexibility.
> 
> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
> ---
>  include/linux/kvm_host.h | 1 +
>  virt/kvm/kvm_main.c      | 5 +++--
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> index 81089cf..1bef9e2 100644
> --- a/include/linux/kvm_host.h
> +++ b/include/linux/kvm_host.h
> @@ -242,6 +242,7 @@ struct kvm_vcpu {
>  	int sigset_active;
>  	sigset_t sigset;
>  	struct kvm_vcpu_stat stat;
> +	unsigned int halt_poll_ns;
>  
>  #ifdef CONFIG_HAS_IOMEM
>  	int mmio_needed;
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index d8db2f8f..c06e57c 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -217,6 +217,7 @@ int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id)
>  	vcpu->kvm = kvm;
>  	vcpu->vcpu_id = id;
>  	vcpu->pid = NULL;
> +	vcpu->halt_poll_ns = 0;
>  	init_waitqueue_head(&vcpu->wq);
>  	kvm_async_pf_vcpu_init(vcpu);
>  
> @@ -1930,8 +1931,8 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
>  	bool waited = false;
>  
>  	start = cur = ktime_get();
> -	if (halt_poll_ns) {
> -		ktime_t stop = ktime_add_ns(ktime_get(), halt_poll_ns);
> +	if (vcpu->halt_poll_ns) {
> +		ktime_t stop = ktime_add_ns(ktime_get(), vcpu->halt_poll_ns);
>  
>  		do {
>  			/*
> 

Applied, thanks.

Paolo

  reply	other threads:[~2015-09-06 14:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1441289259-32072-1-git-send-email-wanpeng.li@hotmail.com>
2015-09-03 14:07 ` [PATCH v7 1/3] KVM: make halt_poll_ns per-vCPU Wanpeng Li
2015-09-06 14:33   ` Paolo Bonzini [this message]
2015-09-03 14:07 ` [PATCH v7 2/3] KVM: dynamic halt-polling Wanpeng Li
2015-09-04 22:38   ` Wanpeng Li
2015-09-06 14:32     ` Paolo Bonzini
2015-09-06 22:23       ` Wanpeng Li
2015-09-03 14:07 ` [PATCH v7 3/3] KVM: trace kvm_halt_poll_ns grow/shrink 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=55EC4ED0.90703@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=dmatlack@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wanpeng.li@hotmail.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.