summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/kvm_cache_regs.h
diff options
context:
space:
mode:
authorTakuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>2010-04-28 18:50:36 +0900
committerAvi Kivity <avi@redhat.com>2010-08-01 10:35:27 +0300
commit914ebccd2d8fa439e01fe93b5229534b9e179a69 (patch)
tree13341c1b1fcd6d4eeb39576c75417cccbcdee748 /arch/x86/kvm/kvm_cache_regs.h
parentc332c83ae736c72dcf072e96e98a774fce39e722 (diff)
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 <yoshikawa.takuya@oss.ntt.co.jp> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/kvm_cache_regs.h')
0 files changed, 0 insertions, 0 deletions