瀏覽代碼

migration/multifd: Enable multifd zero page checking by default.

1. Set default "zero-page-detection" option to "multifd". Now
zero page checking can be done in the multifd threads and this
becomes the default configuration.
2. Handle migration QEMU9.0 -> QEMU8.2 compatibility. We provide
backward compatibility where zero page checking is done from the
migration main thread.

Signed-off-by: Hao Xiang <hao.xiang@bytedance.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/r/20240311180015.3359271-7-hao.xiang@linux.dev
Signed-off-by: Peter Xu <peterx@redhat.com>
Hao Xiang 1 年之前
父節點
當前提交
70c25c92e6
共有 3 個文件被更改,包括 7 次插入5 次删除
  1. 3 1
      hw/core/machine.c
  2. 1 1
      migration/options.c
  3. 3 3
      qapi/migration.json

+ 3 - 1
hw/core/machine.c

@@ -32,7 +32,9 @@
 #include "hw/virtio/virtio-net.h"
 #include "hw/virtio/virtio-net.h"
 #include "audio/audio.h"
 #include "audio/audio.h"
 
 
-GlobalProperty hw_compat_8_2[] = {};
+GlobalProperty hw_compat_8_2[] = {
+    { "migration", "zero-page-detection", "legacy"},
+};
 const size_t hw_compat_8_2_len = G_N_ELEMENTS(hw_compat_8_2);
 const size_t hw_compat_8_2_len = G_N_ELEMENTS(hw_compat_8_2);
 
 
 GlobalProperty hw_compat_8_1[] = {
 GlobalProperty hw_compat_8_1[] = {

+ 1 - 1
migration/options.c

@@ -181,7 +181,7 @@ Property migration_properties[] = {
                       MIG_MODE_NORMAL),
                       MIG_MODE_NORMAL),
     DEFINE_PROP_ZERO_PAGE_DETECTION("zero-page-detection", MigrationState,
     DEFINE_PROP_ZERO_PAGE_DETECTION("zero-page-detection", MigrationState,
                        parameters.zero_page_detection,
                        parameters.zero_page_detection,
-                       ZERO_PAGE_DETECTION_LEGACY),
+                       ZERO_PAGE_DETECTION_MULTIFD),
 
 
     /* Migration capabilities */
     /* Migration capabilities */
     DEFINE_PROP_MIG_CAP("x-xbzrle", MIGRATION_CAPABILITY_XBZRLE),
     DEFINE_PROP_MIG_CAP("x-xbzrle", MIGRATION_CAPABILITY_XBZRLE),

+ 3 - 3
qapi/migration.json

@@ -909,7 +909,7 @@
 #        (Since 8.2)
 #        (Since 8.2)
 #
 #
 # @zero-page-detection: Whether and how to detect zero pages.
 # @zero-page-detection: Whether and how to detect zero pages.
-#     See description in @ZeroPageDetection.  Default is 'legacy'.
+#     See description in @ZeroPageDetection.  Default is 'multifd'.
 #     (since 9.0)
 #     (since 9.0)
 #
 #
 # Features:
 # Features:
@@ -1106,7 +1106,7 @@
 #        (Since 8.2)
 #        (Since 8.2)
 #
 #
 # @zero-page-detection: Whether and how to detect zero pages.
 # @zero-page-detection: Whether and how to detect zero pages.
-#     See description in @ZeroPageDetection.  Default is 'legacy'.
+#     See description in @ZeroPageDetection.  Default is 'multifd'.
 #     (since 9.0)
 #     (since 9.0)
 #
 #
 # Features:
 # Features:
@@ -1339,7 +1339,7 @@
 #        (Since 8.2)
 #        (Since 8.2)
 #
 #
 # @zero-page-detection: Whether and how to detect zero pages.
 # @zero-page-detection: Whether and how to detect zero pages.
-#     See description in @ZeroPageDetection.  Default is 'legacy'.
+#     See description in @ZeroPageDetection.  Default is 'multifd'.
 #     (since 9.0)
 #     (since 9.0)
 #
 #
 # Features:
 # Features: