From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 6/8] x86: KVM guest: hypercall batching Date: Thu, 06 Mar 2008 09:11:05 +0200 Message-ID: <47CF9909.8010402@qumranet.com> References: <1204475481-16583-7-git-send-email-avi@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net, Marcelo Tosatti To: Zhao Forrest Return-path: In-Reply-To: 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 Zhao Forrest wrote: > Hi Avi, > > After reading the patch, I think the hypercall batching mechanism is as follows: > 1 defer the MMU-related operations and buffer them in > kvm_para_state->mmu_queue[] > 2 during the flush period, kvm_mmu_op() is called to flush operations > in kvm_para_state->mmu_queue[] > 3 kvm_mmu_op() generate a hypercall for each operation in > kvm_para_state->mmu_queue[]; thus trigger a context switch from guest > mode to kernel mode for each operation. > > My question is: Is it possible to only generate a single > hypercall(thus a single context switch) for all buffered MMU > operations in kvm_para_state->mmu_queue[]? This way we could further > reduce overhead, am I right? > BTW. I don't have a deep understanding of KVM. So this is just a > question out of my curiosity. > > mmu_queue_flush() is called once per batch, so we only have one hypercall per batch (at least if the data doesn't exceed 512 bytes). -- 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/