[Devel] [PATCH RHEL7 COMMIT] ms/kvm: fix polling for guest halt continued even if disable it

Konstantin Khorenko khorenko at virtuozzo.com
Tue Apr 19 03:22:50 PDT 2016


The commit is pushed to "branch-rh7-3.10.0-327.10.1.vz7.12.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.10.1.vz7.12.11
------>
commit a659c4d75784fada53c3ff3d5bf0e1daaedf5303
Author: Wanpeng Li <wanpeng.li at hotmail.com>
Date:   Tue Apr 19 14:22:50 2016 +0400

    ms/kvm: fix polling for guest halt continued even if disable it
    
    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 at de.ibm.com>
    Signed-off-by: Wanpeng Li <wanpeng.li at hotmail.com>
    Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
    (cherry picked from commit edb9272f35d8bc97c86101a13f67d0ba16f3eecc)
    
    Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov at virtuozzo.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 c38313e..fb7a6b9 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2039,7 +2039,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);
 }


More information about the Devel mailing list