Tags: xzpeter/qemu
Tags
hostmem/memfd: Support huge pages for guest-memfd Reuse the "hugetlb" and "hugetlbsize" parameter for memory-backend-memfd, but start applying that on top of guest-memfds too. Signed-off-by: Peter Xu <[email protected]>
kvm/x86: TSC caliberations based on kvmclock TSC and kvmclock are two clock sources that guest OS can use, and the guest normally would require both clock to move forward in the same pace. TBD. Signed-off-by: Peter Xu <[email protected]>
x86/kvm: Add tracepoints for kvmclock Signed-off-by: Peter Xu <[email protected]>
Migration patches for 9.0 - We lost Juan and Leo in the maintainers file - Steven's suspend state fix - Steven's fix for coverity on migrate_mode - Avihai's migration cleanup series
Migration patches for rc3: - One more memleak regression fix from Het
migration: Collapse huge pages again after postcopy finished When hugetlb-doublemap enabled, the pages will be migrated in small page sizes during postcopy. When the migration finishes, the pgtable needs to be rebuilt explicitly for these ranges to have huge page being mapped again. Signed-off-by: Peter Xu <[email protected]>
tests: Add postcopy preempt test Two tests are added: a normal postcopy preempt test, and a recovery test. Signed-off-by: Peter Xu <[email protected]>
tests: Add postcopy preempt test Signed-off-by: Peter Xu <[email protected]>
migration: Create postcopy preempt thread on dst VM Create a standalone thread to receive postcopy requested pages. The thread is created along with the ram listen thread during POSTCOPY_LISTEN phase. Signed-off-by: Peter Xu <[email protected]>
KVM: Dirty ring support (QEMU part) I kept the dirty sync in kvm_set_phys_mem() for kvmslot removals, left a comment on the known issue about strict dirty sync so we can fix it someday in the future together with dirty log and dirty ring. v3: - added "KVM: Use a big lock to replace per-kml slots_lock" this is preparing for the last patch where we'll reap kvm dirty ring when removing kvmslots. - added "KVM: Simplify dirty log sync in kvm_set_phys_mem" it's kind of a fix, but also a preparation of the last patch so it'll be very easy to add the dirty ring sync there - the last patch is changed to handle correctly the dirty sync in kvmslot removal, also comment there about the known issues. - reordered the patches a bit - NOTE: since we kept the sync in memslot removal, this version does not depend on any other QEMU series - it is based on QEMU master v2: - add r-bs for Dave - change dirty-ring-size parameter from int64 to uint64_t [Dave] - remove an assertion for KVM_GET_DIRTY_LOG [Dave] - document update: "per vcpu" dirty ring [Dave] - rename KVMReaperState to KVMDirtyRingReaperState [Dave] - dump errno when kvm_init_vcpu fails with dirty ring [Dave] - switch to use dirty-ring-gfns as parameter [Dave] - comment MAP_SHARED [Dave] - dump more info when enable dirty ring failed [Dave] - add kvm_dirty_ring_enabled flag to show whether dirty ring enabled - rewrote many of the last patch to reduce LOC, now we do dirty ring reap only with BQL to simplify things, allowing the main or vcpu thread to directly call kvm_dirty_ring_reap() to collect dirty pages, so that we can drop a lot of synchronization variables like sems or eventfds. For anyone who wants to try (we need to upgrade kernel too): KVM branch: https://github.com/xzpeter/linux/tree/kvm-dirty-ring QEMU branch for testing: https://github.com/xzpeter/qemu/tree/kvm-dirty-ring Overview ======== KVM dirty ring is a new interface to pass over dirty bits from kernel to the userspace. Instead of using a bitmap for each memory region, the dirty ring contains an array of dirtied GPAs to fetch, one ring per vcpu. There're a few major changes comparing to how the old dirty logging interface would work: - Granularity of dirty bits KVM dirty ring interface does not offer memory region level granularity to collect dirty bits (i.e., per KVM memory slot). Instead the dirty bit is collected globally for all the vcpus at once. The major effect is on VGA part because VGA dirty tracking is enabled as long as the device is created, also it was in memory region granularity. Now that operation will be amplified to a VM sync. Maybe there's smarter way to do the same thing in VGA with the new interface, but so far I don't see it affects much at least on regular VMs. - Collection of dirty bits The old dirty logging interface collects KVM dirty bits when synchronizing dirty bits. KVM dirty ring interface instead used a standalone thread to do that. So when the other thread (e.g., the migration thread) wants to synchronize the dirty bits, it simply kick the thread and wait until it flushes all the dirty bits to the ramblock dirty bitmap. A new parameter "dirty-ring-size" is added to "-accel kvm". By default, dirty ring is still disabled (size==0). To enable it, we need to be with: -accel kvm,dirty-ring-size=65536 This establishes a 64K dirty ring buffer per vcpu. Then if we migrate, it'll switch to dirty ring. I gave it a shot with a 24G guest, 8 vcpus, using 10g NIC as migration channel. When idle or dirty workload small, I don't observe major difference on total migration time. When with higher random dirty workload (800MB/s dirty rate upon 20G memory, worse for kvm dirty ring). Total migration time is (ping pong migrate for 6 times, in seconds): |-------------------------+---------------| | dirty ring (4k entries) | dirty logging | |-------------------------+---------------| | 70 | 58 | | 78 | 70 | | 72 | 48 | | 74 | 52 | | 83 | 49 | | 65 | 54 | |-------------------------+---------------| Summary: dirty ring average: 73s dirty logging average: 55s The KVM dirty ring will be slower in above case. The number may show that the dirty logging is still preferred as a default value because small/medium VMs are still major cases, and high dirty workload happens frequently too. And that's what this series did. Please refer to the code and comment itself for more information. Thanks,
PreviousNext