From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages Date: Fri, 22 Mar 2013 18:01:53 +0800 Message-ID: <514C2C11.1060004@linux.vnet.ibm.com> References: <1363768227-4782-1-git-send-email-xiaoguangrong@linux.vnet.ibm.com> <20130321222151.GA19821@amt.cnet> <514BBDC5.6090104@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , gleb@redhat.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org To: Xiao Guangrong Return-path: In-Reply-To: <514BBDC5.6090104@linux.vnet.ibm.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 03/22/2013 10:11 AM, Xiao Guangrong wrote: >> The modifications should be contained to kvm_mmu_get_page() mostly, >> correct? (would also have to keep counters to increase SLAB freeing >> ratio, relative to number of outdated shadow pages). > > Yes. > >> >> And then have codepaths that nuke shadow pages break from the spinlock, > > I think this is not needed any more. We can let mmu_notify use the generation > number to invalid all shadow pages, then we only need to free them after > all vcpus down and mmu_notify unregistered - at this point, no lock contention, > we can directly free them. Sorry. This is wrong since after call ->release(), the memory will be freed. zap-all-sp can not be delayed. Will think out a good way to handle this...