From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH v7 03/11] KVM: MMU: fast invalidate all pages Date: Mon, 27 May 2013 10:02:29 +0800 Message-ID: <51A2BEB5.9030900@linux.vnet.ibm.com> References: <1369252560-11611-1-git-send-email-xiaoguangrong@linux.vnet.ibm.com> <1369252560-11611-4-git-send-email-xiaoguangrong@linux.vnet.ibm.com> <20130524202307.GA4525@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: gleb@redhat.com, avi.kivity@gmail.com, pbonzini@redhat.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org To: Marcelo Tosatti Return-path: In-Reply-To: <20130524202307.GA4525@amt.cnet> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Hi Marcelo, On 05/25/2013 04:23 AM, Marcelo Tosatti wrote: >> +static void kvm_zap_obsolete_pages(struct kvm *kvm) >> +{ >> + struct kvm_mmu_page *sp, *node; >> + LIST_HEAD(invalid_list); >> + >> +restart: >> + list_for_each_entry_safe_reverse(sp, node, >> + &kvm->arch.active_mmu_pages, link) { >> + /* >> + * No obsolete page exists before new created page since >> + * active_mmu_pages is the FIFO list. >> + */ >> + if (!is_obsolete_sp(kvm, sp)) >> + break; > > Can you add a comment to list_add(x, active_mmu_pages) callsites > mentioning this case? > > Because it'll break silently if people do list_add_tail(). Sure, I will do it in the next version. And i totally agree with Gleb's points that reply your other questions in this patch. Thank you all!