From patchwork Mon Jul 23 14:06:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Guangrong X-Patchwork-Id: 1227951 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A76EB3FCFC for ; Mon, 23 Jul 2012 14:06:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753487Ab2GWOGa (ORCPT ); Mon, 23 Jul 2012 10:06:30 -0400 Received: from e28smtp01.in.ibm.com ([122.248.162.1]:48622 "EHLO e28smtp01.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753178Ab2GWOG3 (ORCPT ); Mon, 23 Jul 2012 10:06:29 -0400 Received: from /spool/local by e28smtp01.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 23 Jul 2012 19:36:27 +0530 Received: from d28relay05.in.ibm.com (9.184.220.62) by e28smtp01.in.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 23 Jul 2012 19:36:24 +0530 Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6NE6OIr20381822; Mon, 23 Jul 2012 19:36:24 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6NE6Ng4029421; Tue, 24 Jul 2012 00:06:23 +1000 Received: from localhost.localdomain ([9.123.236.99]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q6NE6LUd029329; Tue, 24 Jul 2012 00:06:21 +1000 Message-ID: <500D5A5D.8080703@linux.vnet.ibm.com> Date: Mon, 23 Jul 2012 22:06:21 +0800 From: Xiao Guangrong User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Xiao Guangrong CC: Avi Kivity , Marcelo Tosatti , LKML , KVM Subject: [PATCH 2/3] KVM: use kvm_release_page_clean to guest page References: <500D59A7.9060503@linux.vnet.ibm.com> <500D5A1E.6000704@linux.vnet.ibm.com> In-Reply-To: <500D5A1E.6000704@linux.vnet.ibm.com> x-cbid: 12072314-4790-0000-0000-000003D11476 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org In kvm_async_pf_wakeup_all, it uses bad_page to generate broadcast wakeup, and use put_page to release the page, the work depends on bad_page is the normal page. But we will use the error code instead of bad_page, so use kvm_release_page_clean to release the page which will release the error code probably Signed-off-by: Xiao Guangrong --- virt/kvm/async_pf.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/virt/kvm/async_pf.c b/virt/kvm/async_pf.c index 74268b4..ebae24b 100644 --- a/virt/kvm/async_pf.c +++ b/virt/kvm/async_pf.c @@ -112,7 +112,7 @@ void kvm_clear_async_pf_completion_queue(struct kvm_vcpu *vcpu) typeof(*work), link); list_del(&work->link); if (work->page) - put_page(work->page); + kvm_release_page_clean(work->page); kmem_cache_free(async_pf_cache, work); } spin_unlock(&vcpu->async_pf.lock); @@ -139,7 +139,7 @@ void kvm_check_async_pf_completion(struct kvm_vcpu *vcpu) list_del(&work->queue); vcpu->async_pf.queued--; if (work->page) - put_page(work->page); + kvm_release_page_clean(work->page); kmem_cache_free(async_pf_cache, work); } }