linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: fix polling for guest halt continued even if disable it
@ 2015-09-14  9:38 Wanpeng Li
  2015-09-15  7:16 ` Christian Borntraeger
  0 siblings, 1 reply; 2+ messages in thread
From: Wanpeng Li @ 2015-09-14  9:38 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Christian Borntraeger, kvm, linux-kernel, Wanpeng Li

If there is already some polling ongoing, it's impossible to disable the 
polling, since as soon as somebody sets halt_poll_ns to 0, polling will 
never stop, as grow and shrink are only handled if halt_poll_ns is != 0.

This patch fix it by reset vcpu->halt_poll_ns in order to stop polling 
when polling is disabled.

Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
---
 virt/kvm/kvm_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 4662a88..f756cac0 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2012,7 +2012,8 @@ out:
 		else if (vcpu->halt_poll_ns < halt_poll_ns &&
 			block_ns < halt_poll_ns)
 			grow_halt_poll_ns(vcpu);
-	}
+	} else
+		vcpu->halt_poll_ns = 0;
 
 	trace_kvm_vcpu_wakeup(block_ns, waited);
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: fix polling for guest halt continued even if disable it
  2015-09-14  9:38 [PATCH] KVM: fix polling for guest halt continued even if disable it Wanpeng Li
@ 2015-09-15  7:16 ` Christian Borntraeger
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Borntraeger @ 2015-09-15  7:16 UTC (permalink / raw)
  To: Wanpeng Li, Paolo Bonzini; +Cc: kvm, linux-kernel

Am 14.09.2015 um 11:38 schrieb Wanpeng Li:
> If there is already some polling ongoing, it's impossible to disable the 
> polling, since as soon as somebody sets halt_poll_ns to 0, polling will 
> never stop, as grow and shrink are only handled if halt_poll_ns is != 0.
> 
> This patch fix it by reset vcpu->halt_poll_ns in order to stop polling 
> when polling is disabled.
> 
> Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
> ---
>  virt/kvm/kvm_main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 4662a88..f756cac0 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -2012,7 +2012,8 @@ out:
>  		else if (vcpu->halt_poll_ns < halt_poll_ns &&
>  			block_ns < halt_poll_ns)
>  			grow_halt_poll_ns(vcpu);
> -	}
> +	} else
> +		vcpu->halt_poll_ns = 0;
> 
>  	trace_kvm_vcpu_wakeup(block_ns, waited);
>  }
> 

Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-15  7:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-14  9:38 [PATCH] KVM: fix polling for guest halt continued even if disable it Wanpeng Li
2015-09-15  7:16 ` Christian Borntraeger

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).