Skip to content

Commit

Permalink
KVM: async_pf: Allow to wait for outstanding work
Browse files Browse the repository at this point in the history
On s390 we are not able to cancel work. Instead we will flush the work and wait for
completion.

Signed-off-by: Dominik Dingel <[email protected]>
Signed-off-by: Christian Borntraeger <[email protected]>
  • Loading branch information
Dominik Dingel authored and borntraeger committed Jan 30, 2014
1 parent e0ead41 commit 9f2ceda
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions virt/kvm/async_pf.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,16 @@ void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu)
list_entry(vcpu->async_pf.queue.next,
typeof(*work), queue);
list_del(&work->queue);

#ifdef CONFIG_KVM_ASYNC_PF_SYNC
flush_work(&work->work);
#else
if (cancel_work_sync(&work->work)) {
mmdrop(work->mm);
kvm_put_kvm(vcpu->kvm); /* == work->vcpu->kvm */
kmem_cache_free(async_pf_cache, work);
}
#endif
}

spin_lock(&vcpu->async_pf.lock);
Expand Down

0 comments on commit 9f2ceda

Please sign in to comment.