提交 3fca0365 编写于 作者: Y Yaozu Dong 提交者: Avi Kivity

KVM: VMX: Avoid unnecessary vcpu_load()/vcpu_put() cycles

By checking if a reschedule is needed, we avoid dropping the vcpu.

[With changes by me, based on Anthony Liguori's observations]
Signed-off-by: NAvi Kivity <avi@qumranet.com>
上级 d6c69ee9
......@@ -1590,6 +1590,8 @@ static int set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
void kvm_resched(struct kvm_vcpu *vcpu)
{
if (!need_resched())
return;
vcpu_put(vcpu);
cond_resched();
vcpu_load(vcpu);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册