Skip to content

Introduce multifd zero page checking.

Hao Xiang qemu-devel 2 versions – Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest7 patches 5 repliesApplied
  2. v57 patches 0 repliesSuperseded

Patches in v6 Applied

#Subject and filesSizeRepliesApplied
1/7migration/multifd: Allow zero pages in file migrationmigration/file.c+1 -10 replies
2/7migration/multifd: Allow clearing of the file_bmap from multifdmigration/multifd.c migration/ram.c migration/ram.h+9 -40 replies
3/7migration/multifd: Add new migration option zero-page-detection.hw/core/qdev-properties-system.c include/hw/qdev-properties-system.h migration/migration-hmp-cmds.c +4 more+79 -30 replies
4/7migration/multifd: Implement zero page transmission on the multifd thread.hw/core/qdev-properties-system.c migration/meson.build migration/multifd-zero-page.c +7 more+228 -321 reply
5/7migration/multifd: Implement ram_save_target_page_multifd to handle multifd version of MigrationOps::ram_save_target_page.migration/ram.c+29 -90 replies
6/7migration/multifd: Enable multifd zero page checking by default.hw/core/machine.c migration/options.c qapi/migration.json+7 -52 replies
7/7migration/multifd: Add new migration test cases for legacy zero page checking.tests/qtest/migration-test.c+52 -01 reply

Reviews trailers per patch

5 of 7 patches have a Reviewed-by or Acked-by.

PatchPeter XuMarkus ArmbrusterFabiano Rosas
1/7
2/7
3/7R-b A-b
4/7A-b R-b
5/7R-b
6/7R-b R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v6 thread

Cover letter [PATCH v6 0/7] Introduce multifd zero page checking.

v6 update:
* Make ZERO_PAGE_DETECTION_NONE option work in legacy migration.
* Rebase on top of 7489f7f3f81dcb776df8c1b9a9db281fc21bf05f.

v5 update:
* Move QEMU9.0 -> QEMU8.2 migration backward compatibility handling into the patch where "multifd" zero page checking becomes the default option.
* A few function renaming according to feedback.
* Fix bug in multifd_send_zero_page_detect.
* Rebase on the new mapped-ram feature.
* Pulled in 2 commits from Fabiano.

v4 update:
* Fix documentation for interface ZeroPageDetection.
* Fix implementation in multifd_send_zero_page_check.
* Rebase on top of c0c6a0e3528b88aaad0b9d333e295707a195587b.

v3 update:
* Change "zero" to "zero-pages" and use type size for "zero-bytes".
* Fixed ZeroPageDetection interface description.
* Move zero page unit tests to its own path.
* Removed some asserts.
* Added backward compatibility support for migration 9.0 -> 8.2.
* Removed fields "zero" and "normal" page address arrays from v2. Now multifd_zero_page_check_send sorts normal/zero pages in the "offset" array.

v2 update:
* Implement zero-page-detection switch with enumeration "legacy", "none" and "multifd".
* Move normal/zero pages from MultiFDSendParams to MultiFDPages_t.
* Add zeros and zero_bytes accounting.

This patchset is based on Juan Quintela's old series here
https://lore.kernel.org/all/[email protected]/

In the multifd live migration model, there is a single migration main thread scanning the page map, queuing the pages to multiple multifd sender threads. The migration main thread runs zero page checking on every page before queuing the page to the sender threads. Zero page checking is a CPU intensive task and hence having a single thread doing all that doesn't scale well. This change introduces a new function to run the zero page checking on the multifd sender threads. This patchset also lays the ground work for future changes to offload zero page checking task to accelerator hardwares.

Use two Intel 4th generation Xeon servers for testing.

Architecture:        x86_64
CPU(s):              192
Thread(s) per core:  2
Core(s) per socket:  48
Socket(s):           2
NUMA node(s):        2
Vendor ID:           GenuineIntel
CPU family:          6
Model:               143
Model name:          Intel(R) Xeon(R) Platinum 8457C
Stepping:            8
CPU MHz:             2538.624
CPU max MHz:         3800.0000
CPU min MHz:         800.0000

Perform multifd live migration with below setup:
1. VM has 100GB memory. All pages in the VM are zero pages.
2. Use tcp socket for live migration.
3. Use 4 multifd channels and zero page checking on migration main thread.
4. Use 1/2/4 multifd channels and zero page checking on multifd sender threads.
5. Record migration total time from sender QEMU console's "info migrate" command.

+------------------------------------+
|zero-page-checking | total-time(ms) |
+------------------------------------+
|main-thread        | 9629           |
+------------------------------------+
|multifd-1-threads  | 6182           |
+------------------------------------+
|multifd-2-threads  | 4643           |
+------------------------------------+
|multifd-4-threads  | 4143           |
+------------------------------------+

Apply this patchset on top of commit
7489f7f3f81dcb776df8c1b9a9db281fc21bf05f

Fabiano Rosas (2):
migration/multifd: Allow zero pages in file migration migration/multifd: Allow clearing of the file_bmap from multifd

Hao Xiang (5):
migration/multifd: Add new migration option zero-page-detection. migration/multifd: Implement zero page transmission on the multifd
thread.
migration/multifd: Implement ram_save_target_page_multifd to handle
multifd version of MigrationOps::ram_save_target_page.
migration/multifd: Enable multifd zero page checking by default. migration/multifd: Add new migration test cases for legacy zero page
checking.

 hw/core/machine.c                   |  4 +-
 hw/core/qdev-properties-system.c    | 10 ++++
 include/hw/qdev-properties-system.h |  4 ++
 migration/file.c                    |  2 +-
 migration/meson.build               |  1 +
 migration/migration-hmp-cmds.c      |  9 +++
 migration/multifd-zero-page.c       | 87 +++++++++++++++++++++++++++
 migration/multifd-zlib.c            | 21 +++++--
 migration/multifd-zstd.c            | 20 +++++--
 migration/multifd.c                 | 92 ++++++++++++++++++++++++-----
 migration/multifd.h                 | 23 +++++++-
 migration/options.c                 | 21 +++++++
 migration/options.h                 |  1 +
 migration/ram.c                     | 51 ++++++++++++----
 migration/ram.h                     |  3 +-
 migration/trace-events              |  8 +--
 qapi/migration.json                 | 38 +++++++++++-
 tests/qtest/migration-test.c        | 52 ++++++++++++++++
 18 files changed, 399 insertions(+), 48 deletions(-)
 create mode 100644 migration/multifd-zero-page.c
Signature · 1 line
2.30.2