Re: [PATCH 2/2] KVM: x86: pre-allocate one more dirty bitmap to avoid vmalloc() in kvm_vm_ioctl_get_dirty_log()

Avi Kivity
2010-06-09T13:11:39Z

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