From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH 2/2] KVM: pre-allocate one more dirty bitmap to avoid vmalloc() in x86's kvm_vm_ioctl_get_dirty_log() Date: Thu, 21 Oct 2010 16:59:22 -0200 Message-ID: <20101021185922.GA30703@amt.cnet> References: <20101021173747.37e464ce.yoshikawa.takuya@oss.ntt.co.jp> <20101021174033.e2e4c349.yoshikawa.takuya@oss.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: avi@redhat.com, kvm@vger.kernel.org, fernando@oss.ntt.co.jp To: Takuya Yoshikawa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:30567 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751332Ab0JVBlv (ORCPT ); Thu, 21 Oct 2010 21:41:51 -0400 Content-Disposition: inline In-Reply-To: <20101021174033.e2e4c349.yoshikawa.takuya@oss.ntt.co.jp> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Oct 21, 2010 at 05:40:33PM +0900, Takuya Yoshikawa wrote: > Currently x86's kvm_vm_ioctl_get_dirty_log() needs to allocate a bitmap by > vmalloc() which will be used in the next logging and this has been causing > bad effect to VGA and live-migration: vmalloc() consumes extra systime, > triggers tlb flush, etc. > > This patch resolves this issue by pre-allocating one more bitmap and switching > between two bitmaps during dirty logging. > > Performance improvement: > I measured performance for the case of VGA update by trace-cmd. > So the result was 1.5 times faster than the original. > > > In the case of live migration, the improvement ratio depends on the workload > and the guest memory size. > > Note: > This does not change other architectures's logic but the allocation size > becomes twice. This will increase the actual memory consumption only when > the new size changes the number of pages allocated by vmalloc(). > > Signed-off-by: Takuya Yoshikawa > Signed-off-by: Fernando Luis Vazquez Cao Looks good to me.