diff options
author | Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> | 2010-11-01 10:01:28 +0100 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-01-12 10:29:00 +0100 |
commit | e6d53e3b0db7ae3641f01a2b2af1470fda86d10c (patch) | |
tree | 95b94e3caa16222379ef708ed6a073ddbc95a0a8 /virt/kvm | |
parent | KVM: fix searching async gfn in kvm_async_pf_gfn_slot (diff) | |
download | linux-e6d53e3b0db7ae3641f01a2b2af1470fda86d10c.tar.xz linux-e6d53e3b0db7ae3641f01a2b2af1470fda86d10c.zip |
KVM: avoid unnecessary wait for a async pf
In current code, it checks async pf completion out of the wait context,
like this:
if (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE &&
!vcpu->arch.apf.halted)
r = vcpu_enter_guest(vcpu);
else {
......
kvm_vcpu_block(vcpu)
^- waiting until 'async_pf.done' is not empty
}
kvm_check_async_pf_completion(vcpu)
^- delete list from async_pf.done
So, if we check aysnc pf completion first, it can be blocked at
kvm_vcpu_block
Fixed by mark the vcpu is unhalted in kvm_check_async_pf_completion()
path
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Acked-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm')
0 files changed, 0 insertions, 0 deletions