From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch 3/5] KVM: hypercall batching (v2) Date: Fri, 22 Feb 2008 09:10:47 +0200 Message-ID: <47BE7577.6000305@qumranet.com> References: <20080220194720.750258362@harmony.lab.boston.redhat.com> <20080220195019.708528773@harmony.lab.boston.redhat.com> <47BD9E39.9050204@qumranet.com> <20080221180512.GA30703@dmt> <47BDC32C.4040402@qumranet.com> <20080221193143.GA32580@dmt> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net To: Marcelo Tosatti Return-path: In-Reply-To: <20080221193143.GA32580@dmt> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org Marcelo Tosatti wrote: > On Thu, Feb 21, 2008 at 08:30:04PM +0200, Avi Kivity wrote: > >>> Perhaps you want to move that enforcement to the host. >>> >>> This allows batching of future hypercalls (if appropriate) to be easy. >>> >>> >>> >> I'm still uneasy about it, though I have no rational reasons left now. >> >> Oh, there is one: with a MMU_OP hypercall you can take the mmu spinlock >> once per batch (dropping it once in a while to let another vcpu make >> progress or to inject an interrupt). >> > > emulator_write_phys() needs to do blocking work for each pte > (mmu_guess_page_from_pte), so that optimization would need quite some > work (separate mmu_guess_page_from_pte from kvm_mmu_pte_write). > > And you can do this optimization even without MMU_OP, just check in > advance how many operations will take the mmu lock, do the non-blocking > part of them, and then manipulate the mmu lock protected shadow data. > > Also, holding the spinlock for a longer period is not necessarily an > improvement (with the slots_lock it clearly is because there is no write > contention). > > Yes, you are right. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/