Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15096ffc authored by Xiao Guangrong's avatar Xiao Guangrong Committed by Avi Kivity
Browse files

KVM: handle more completed apfs if possible



If it's no need to inject async #PF to PV guest we can handle
more completed apfs at one time, so we can retry guest #PF
as early as possible

Signed-off-by: default avatarXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Acked-by: default avatarGleb Natapov <gleb@redhat.com>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent e6d53e3b
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -124,12 +124,11 @@ void kvm_check_async_pf_completion(struct kvm_vcpu *vcpu)
{
	struct kvm_async_pf *work;

	if (list_empty_careful(&vcpu->async_pf.done) ||
	    !kvm_arch_can_inject_async_page_present(vcpu))
		return;

	while (!list_empty_careful(&vcpu->async_pf.done) &&
	      kvm_arch_can_inject_async_page_present(vcpu)) {
		spin_lock(&vcpu->async_pf.lock);
	work = list_first_entry(&vcpu->async_pf.done, typeof(*work), link);
		work = list_first_entry(&vcpu->async_pf.done, typeof(*work),
					      link);
		list_del(&work->link);
		spin_unlock(&vcpu->async_pf.lock);

@@ -143,6 +142,7 @@ void kvm_check_async_pf_completion(struct kvm_vcpu *vcpu)
			put_page(work->page);
		kmem_cache_free(async_pf_cache, work);
	}
}

int kvm_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn,
		       struct kvm_arch_async_pf *arch)