From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 2/2] KVM: x86: pre-allocate one more dirty bitmap to avoid vmalloc() in kvm_vm_ioctl_get_dirty_log() Date: Wed, 09 Jun 2010 16:11:34 +0300 Message-ID: <4C0F9306.3060709@redhat.com> References: <20100603220137.1de53977.yoshikawa.takuya@oss.ntt.co.jp> <20100603220618.3f77e78b.yoshikawa.takuya@oss.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: mtosatti@redhat.com, kvm@vger.kernel.org, fernando@oss.ntt.co.jp, takuya.yoshikawa@gmail.com To: Takuya Yoshikawa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:9492 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752783Ab0FINLj (ORCPT ); Wed, 9 Jun 2010 09:11:39 -0400 In-Reply-To: <20100603220618.3f77e78b.yoshikawa.takuya@oss.ntt.co.jp> Sender: kvm-owner@vger.kernel.org List-ID: On 06/03/2010 04:06 PM, 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 effects 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 the two bitmaps during dirty logging. > > Performance improvement: > In the usual Desktop environment, kvm_vm_ioctl_get_dirty_log() get about > twice faster than the original one for graphical updates. > > During live-migration with low work load, the improvement ratio was > about three when guest memory was 4GB. > > Looks good in general. > Note: > Though this patch introduces some ifdefs, we tried not to mixing these > with other parts to keep the code as clean as possible. > > What's the reason for that? Can't you update the other archs to use this as well? -- error compiling committee.c: too many arguments to function