From: Zhuang Yanying <ann.zhuangyany...@huawei.com> Hi,
Recently I test live-migration vm with 1T memory, find vcpu may hang for up to 4s while starting migration. The reason is memory_global_dirty_log_start taking too long, and the vcpu is waiting for BQL. migrate thread vcpu ------------------------------------------------------------------------------------------------------------------ qemu_mutex_lock_iothread kvm_handle_io memory_global_dirty_log_start /* lasts 4s */ try qemu_mutex_lock_iothread qemu_mutex_unlock_iothread success qemu_mutex_lock_iothread Memory_global_dirty_log_start will cleans up the dirty bits of spte in the KVM, and starts the dirty page tracking of PML.Because the VM's memory is very large, it takes too long time in KVM. Is the following scheme feasibleļ¼ (1)Put the action of turning on dirty page tracking in memory_global_dirty_log_start into asynchronous execution outside BQL. (2)The first time tunrning on dirty page tracking, only clean up the dirty page bits of the 1G pagetable, and the time spent by memory_global_dirty_log_start is reduced. Best regards, -Zhuang Yanying ---