]> git.proxmox.com Git - mirror_qemu.git/commit - memory.c
migration: optimize the downtime
authorJay Zhou <jianjay.zhou@huawei.com>
Fri, 28 Jul 2017 10:28:53 +0000 (18:28 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 1 Aug 2017 15:27:33 +0000 (17:27 +0200)
commit1931076077254a2886daa7c830c7838ebd1f81ef
tree79cd172b4130defaf256155b99b8950234336408
parent8bfce83a3b50d45b7107a50a6cd61d5304a925a2
migration: optimize the downtime

Qemu_savevm_state_cleanup takes about 300ms in my ram migration tests
with a 8U24G vm(20G is really occupied), the main cost comes from
KVM_SET_USER_MEMORY_REGION ioctl when mem.memory_size = 0 in
kvm_set_user_memory_region. In kmod, the main cost is
kvm_zap_obsolete_pages, which traverses the active_mmu_pages list to
zap the unsync sptes.

It can be optimized by delaying memory_global_dirty_log_stop to the next
vm_start.

Changes v2->v3:
 - NULL VMChangeStateHandler if it is deleted and protect the scenario
   of nested invocations of memory_global_dirty_log_start/stop [Paolo]

Changes v1->v2:
 - create a VMChangeStateHandler in memory.c to reduce the coupling [Paolo]

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Message-Id: <1501237733-2736-1-git-send-email-jianjay.zhou@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
memory.c