[Devel] [PATCH RHEL7 COMMIT] ve/kvm: Allow scheduler throttling in __vcpu_run()
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Jan 14 05:30:30 PST 2016
The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.9.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.9.20
------>
commit 8d38fd44f3f25fac328780539b9e27262b929134
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date: Thu Jan 14 17:30:30 2016 +0400
ve/kvm: Allow scheduler throttling in __vcpu_run()
Since __vcpu_run() does not hold any mutexes, it's
save to throttle there.
Otherwise, the character of this place makes it behave
as in-kernel busy loop: while () { cond_resched(); }
and sys cpu usage takes up to 100% cpu.
https://jira.sw.ru/browse/PSBM-42358
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
Reviewed-by: Vladimir Davydov <vdavydov at virtuozzo.com>
---
arch/x86/kvm/x86.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index db1017b..ac64018 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6006,7 +6006,7 @@ static int __vcpu_run(struct kvm_vcpu *vcpu)
}
if (need_resched()) {
srcu_read_unlock(&kvm->srcu, vcpu->srcu_idx);
- cond_resched();
+ cond_resched_may_throttle();
vcpu->srcu_idx = srcu_read_lock(&kvm->srcu);
}
}
More information about the Devel
mailing list