[PATCH 3/5] KVM: ensure pool time is longer than block_ns

From: Zhenzhong Duan
Date: Fri Oct 25 2019 - 23:27:17 EST


When (block_ns == vcpu->halt_poll_ns), there is not a margin so that
vCPU may still get into block state unnecessorily.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@xxxxxxxxxx>
---
virt/kvm/kvm_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 1b6fe3b..48a1f1a 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2371,7 +2371,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
if (!vcpu_valid_wakeup(vcpu)) {
shrink_halt_poll_ns(vcpu);
} else if (halt_poll_ns) {
- if (block_ns <= vcpu->halt_poll_ns)
+ if (block_ns < vcpu->halt_poll_ns)
;
/* we had a short halt and our poll time is too small */
else if (block_ns < halt_poll_ns)
--
1.8.3.1