From: Takuya Yoshikawa Date: Wed, 28 Apr 2010 09:50:36 +0000 (+0900) Subject: KVM: x86: avoid unnecessary bitmap allocation when memslot is clean X-Git-Tag: v2.6.36-rc1~580^2~195 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=914ebccd2d8fa439e01fe93b5229534b9e179a69;p=pandora-kernel.git KVM: x86: avoid unnecessary bitmap allocation when memslot is clean Although we always allocate a new dirty bitmap in x86's get_dirty_log(), it is only used as a zero-source of copy_to_user() and freed right after that when memslot is clean. This patch uses clear_user() instead of doing this unnecessary zero-source allocation. Performance improvement: as we can expect easily, the time needed to allocate a bitmap is completely reduced. In my test, the improved ioctl was about 4 to 10 times faster than the original one for clean slots. Furthermore, reducing memory allocations and copies will produce good effects to caches too. Signed-off-by: Takuya Yoshikawa Signed-off-by: Avi Kivity --- Reading git-diff-tree failed