From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [patch 3/5] KVM: hypercall batching (v2) Date: Thu, 21 Feb 2008 16:31:43 -0300 Message-ID: <20080221193143.GA32580@dmt> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm-devel@lists.sourceforge.net To: Avi Kivity Return-path: Content-Disposition: inline In-Reply-To: <47BDC32C.4040402@qumranet.com> 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 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). ------------------------------------------------------------------------- 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/