From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Nesterov Subject: [PATCH 1/2] KVM: async_pf: kill the unnecessary use_mm/unuse_mm async_pf_execute() Date: Mon, 21 Apr 2014 15:25:58 +0200 Message-ID: <20140421132558.GA13608@redhat.com> References: <20140421132543.GA13594@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Dominik Dingel , Christian Borntraeger , kvm@vger.kernel.org, linux-kernel@vger.kernel.org To: Avi Kivity , Gleb Natapov , Paolo Bonzini Return-path: Content-Disposition: inline In-Reply-To: <20140421132543.GA13594@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 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 --- virt/kvm/async_pf.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/virt/kvm/async_pf.c b/virt/kvm/async_pf.c index 10df100..0ced4f3 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) might_sleep(); - use_mm(mm); down_read(&mm->mmap_sem); get_user_pages(current, mm, addr, 1, 1, 0, NULL, NULL); up_read(&mm->mmap_sem); kvm_async_page_present_sync(vcpu, apf); - unuse_mm(mm); spin_lock(&vcpu->async_pf.lock); list_add_tail(&apf->link, &vcpu->async_pf.done); -- 1.5.5.1