migration: defer migration_end & blk_mig_cleanup

Because of the patch 3ea3b7fa9af067982f34b of kvm, which introduces a
lazy collapsing of small sptes into large sptes mechanism, now
migration_end() is a time consuming operation because it calls
memroy_global_dirty_log_stop(), which will trigger the dropping of small
sptes operation and takes about dozens of milliseconds, so call
migration_end() before all the vmsate data has already been transferred
to the destination will prolong VM downtime. This operation should be
deferred after all the data has been transferred to the destination.

blk_mig_cleanup() can be deferred too.

For a VM with 8G RAM, this patch can reduce the VM downtime about 30 ms.

Signed-off-by: Liang Li <liang.z.li@intel.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>al3
Reviewed-by: Amit Shah <amit.shah@redhat.com>al3
Signed-off-by: Juan Quintela <quintela@redhat.com>al3
3 files changed
tree: 84258ec091fadb00976a785a320c66211f58174d
  1. audio/
  2. backends/
  3. block/
  4. bsd-user/
  5. contrib/
  6. crypto/
  7. default-configs/
  8. disas/
  9. docs/
  10. fpu/
  11. fsdev/
  12. gdb-xml/
  13. hw/
  14. include/
  15. libdecnumber/
  16. linux-headers/
  17. linux-user/
  18. migration/
  19. net/
  20. pc-bios/
  21. po/
  22. qapi/
  23. qga/
  24. qobject/
  25. qom/
  26. roms/
  27. scripts/
  28. slirp/
  29. stubs/
  30. target-alpha/
  31. target-arm/
  32. target-cris/
  33. target-i386/
  34. target-lm32/
  35. target-m68k/
  36. target-microblaze/
  37. target-mips/
  38. target-moxie/
  39. target-openrisc/
  40. target-ppc/
  41. target-s390x/
  42. target-sh4/
  43. target-sparc/
  44. target-tilegx/
  45. target-tricore/
  46. target-unicore32/
  47. target-xtensa/
  48. tcg/
  49. tests/
  50. trace/
  51. ui/
  52. util/
  53. .dir-locals.el
  54. .exrc
  55. .gitignore
  56. .gitmodules
  57. .mailmap
  58. .travis.yml
  59. accel.c
  60. aio-posix.c
  61. aio-win32.c
  62. arch_init.c
  63. async.c
  64. balloon.c
  65. block.c
  66. blockdev-nbd.c
  67. blockdev.c
  68. blockjob.c
  69. bootdevice.c
  70. bt-host.c
  71. bt-vhci.c
  72. Changelog
  73. CODING_STYLE
  74. configure
  75. COPYING
  76. COPYING.LIB
  77. cpu-exec-common.c
  78. cpu-exec.c
  79. cpus.c
  80. cputlb.c
  81. device-hotplug.c
  82. device_tree.c
  83. disas.c
  84. dma-helpers.c
  85. dump.c
  86. exec.c
  87. gdbstub.c
  88. HACKING
  89. hmp-commands-info.hx
  90. hmp-commands.hx
  91. hmp.c
  92. hmp.h
  93. iohandler.c
  94. ioport.c
  95. iothread.c
  96. kvm-all.c
  97. kvm-stub.c
  98. LICENSE
  99. main-loop.c
  100. MAINTAINERS
  101. Makefile
  102. Makefile.objs
  103. Makefile.target
  104. memory.c
  105. memory_mapping.c
  106. module-common.c
  107. monitor.c
  108. nbd.c
  109. numa.c
  110. os-posix.c
  111. os-win32.c
  112. page_cache.c
  113. qapi-schema.json
  114. qdev-monitor.c
  115. qdict-test-data.txt
  116. qemu-bridge-helper.c
  117. qemu-char.c
  118. qemu-doc.texi
  119. qemu-ga.texi
  120. qemu-img-cmds.hx
  121. qemu-img.c
  122. qemu-img.texi
  123. qemu-io-cmds.c
  124. qemu-io.c
  125. qemu-log.c
  126. qemu-nbd.c
  127. qemu-nbd.texi
  128. qemu-options-wrapper.h
  129. qemu-options.h
  130. qemu-options.hx
  131. qemu-seccomp.c
  132. qemu-tech.texi
  133. qemu-timer.c
  134. qemu.nsi
  135. qemu.sasl
  136. qjson.c
  137. qmp-commands.hx
  138. qmp.c
  139. qtest.c
  140. README
  141. rules.mak
  142. softmmu_template.h
  143. spice-qemu-char.c
  144. tcg-runtime.c
  145. tci.c
  146. thread-pool.c
  147. thunk.c
  148. tpm.c
  149. trace-events
  150. translate-all.c
  151. translate-all.h
  152. translate-common.c
  153. user-exec.c
  154. VERSION
  155. version.rc
  156. vl.c
  157. xen-common-stub.c
  158. xen-common.c
  159. xen-hvm-stub.c
  160. xen-hvm.c
  161. xen-mapcache.c