From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gui Jianfeng Subject: Re: [PATCH] KVM: make kvm_mmu_zap_page() return the number of pages it actually freed. Date: Thu, 06 May 2010 17:25:24 +0800 Message-ID: <4BE28B04.2010305@cn.fujitsu.com> References: <4BE0C3F5.1010907@cn.fujitsu.com> <4BE286EA.3070206@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from cn.fujitsu.com ([222.73.24.84]:61060 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751191Ab0EFJ0y (ORCPT ); Thu, 6 May 2010 05:26:54 -0400 In-Reply-To: <4BE286EA.3070206@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > On 05/05/2010 04:03 AM, Gui Jianfeng wrote: >> Currently, kvm_mmu_zap_page() returning the number of freed children sp. >> This might confuse the caller, because caller don't know the actual freed >> number. Let's make kvm_mmu_zap_page() return the number of pages it >> actually >> freed. >> >> > > if (kvm_mmu_zap_page(kvm, sp)) > goto restart; > > Needs to be updated. Hi Avi, if kvm_mmu_zap_page() returns 1, we don't know whether the freed sp is the one we passes into or the child. So here just restart hash walk as long as kvm_mmu_zap_page() returning a positive number, although sometimes un-needed hash walk will happen. This fix gets code simpler, the idea comes from Marcelo. Thanks, Gui >