aboutsummaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2014-04-21 09:25:58 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2014-04-28 11:24:25 -0400
commitd72d946d0b649b79709b99b9d5cb7269fff8afaa (patch)
tree3675c544f3193c0f829fb9b0d60af070a7c785bd /virt
parent198c74f43f0f5473f99967aead30ddc622804bc1 (diff)
KVM: async_pf: kill the unnecessary use_mm/unuse_mm async_pf_execute()
async_pf_execute() has no reasons to adopt apf->mm, gup(current, mm) should work just fine even if current has another or NULL ->mm. Recently kvm_async_page_present_sync() was added insedie the "use_mm" section, but it seems that it doesn't need current->mm too. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Andrea Arcangeli <aarcange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/async_pf.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/virt/kvm/async_pf.c b/virt/kvm/async_pf.c
index 10df100c4514..0ced4f31bc65 100644
--- a/virt/kvm/async_pf.c
+++ b/virt/kvm/async_pf.c
@@ -80,12 +80,10 @@ static void async_pf_execute(struct work_struct *work)
80 80
81 might_sleep(); 81 might_sleep();
82 82
83 use_mm(mm);
84 down_read(&mm->mmap_sem); 83 down_read(&mm->mmap_sem);
85 get_user_pages(current, mm, addr, 1, 1, 0, NULL, NULL); 84 get_user_pages(current, mm, addr, 1, 1, 0, NULL, NULL);
86 up_read(&mm->mmap_sem); 85 up_read(&mm->mmap_sem);
87 kvm_async_page_present_sync(vcpu, apf); 86 kvm_async_page_present_sync(vcpu, apf);
88 unuse_mm(mm);
89 87
90 spin_lock(&vcpu->async_pf.lock); 88 spin_lock(&vcpu->async_pf.lock);
91 list_add_tail(&apf->link, &vcpu->async_pf.done); 89 list_add_tail(&apf->link, &vcpu->async_pf.done);