All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] UFFD write-tracking migration/snapshots
@ 2020-11-18 11:22 Andrey Gruzdev via
  2020-11-18 11:22 ` [PATCH 1/7] Introduce 'track-writes-ram' migration capability Andrey Gruzdev via
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Andrey Gruzdev via @ 2020-11-18 11:22 UTC (permalink / raw)
  To: qemu-devel
  Cc: Den Lunev, Eric Blake, Paolo Bonzini, Juan Quintela,
	Dr . David Alan Gilbert, Markus Armbruster, Andrey Gruzdev

Currently the only way to make (external) live VM snapshot is using existing
dirty page logging migration mechanism. The main problem is that it tends to
produce a lot of page duplicates while running VM goes on updating already
saved pages. That leads to the fact that vmstate image size is commonly several
times bigger then non-zero part of virtual machine's RSS. Time required to
converge RAM migration and the size of snapshot image severely depend on the
guest memory write rate, sometimes resulting in unacceptably long snapshot
creation time and huge image size 

This series propose a way to solve the aforementioned problems. This is done
by using different RAM migration mechanism based on UFFD write protection
management introduced in v5.7 kernel. The migration strategy is to 'freeze'
guest RAM content using write-protection and iteratively release protection
for memory ranges that have already been saved to the migration stream.
At the same time we read in pending UFFD write fault events and save those
pages out-of-order with higher priority.

How to use:
1. Enable write-tracking migration capability
   virsh qemu-monitor-command <domain> --hmp migrate_set_capability track-writes-ram on

2. Start the external migration to a file
   virsh qemu-monitor-command <domain> --hmp migrate exec:'cat > ./vm_state'

3. Wait for the migration finish and check that the migration has completed state.

Andrey Gruzdev (7):
  Introduce 'track-writes-ram' migration capability.
  Introduced UFFD-WP low-level interface helpers. Implemented support
    for the whole RAM block memory protection/un-protection. Higher
    level ram_write_tracking_start() and ram_write_tracking_stop() to
    start/stop tracking memory writes on the whole VM memory.
  Support UFFD write fault processing in ram_save_iterate().
  Implementation of write-tracking migration thread.
  Implementation of vm_start() BH.
  The rest of write tracking migration code.
  Introduced simple linear scan rate limiting mechanism for write
    tracking migration.

 include/exec/memory.h |   7 +
 migration/migration.c | 344 ++++++++++++++++++++++++++++++++-
 migration/migration.h |   4 +
 migration/ram.c       | 439 +++++++++++++++++++++++++++++++++++++++++-
 migration/ram.h       |   4 +
 migration/savevm.c    |   1 -
 migration/savevm.h    |   2 +
 qapi/migration.json   |   7 +-
 8 files changed, 796 insertions(+), 12 deletions(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-11-19  7:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18 11:22 [PATCH 0/7] UFFD write-tracking migration/snapshots Andrey Gruzdev via
2020-11-18 11:22 ` [PATCH 1/7] Introduce 'track-writes-ram' migration capability Andrey Gruzdev via
2020-11-18 14:31   ` Eric Blake
2020-11-19  7:14     ` Andrey Gruzdev
2020-11-18 11:22 ` [PATCH 2/7] Introduced UFFD-WP low-level interface helpers. Implemented support for the whole RAM block memory protection/un-protection. Higher level ram_write_tracking_start() and ram_write_tracking_stop() to start/stop tracking memory writes on the whole VM memory Andrey Gruzdev via
2020-11-18 11:22 ` [PATCH 3/7] Support UFFD write fault processing in ram_save_iterate() Andrey Gruzdev via
2020-11-18 11:22 ` [PATCH 4/7] Implementation of write-tracking migration thread Andrey Gruzdev via
2020-11-18 11:22 ` [PATCH 5/7] Implementation of vm_start() BH Andrey Gruzdev via
2020-11-18 11:22 ` [PATCH 6/7] The rest of write tracking migration code Andrey Gruzdev via
2020-11-18 11:22 ` [PATCH 7/7] Introduced simple linear scan rate limiting mechanism for write tracking migration Andrey Gruzdev via
2020-11-18 11:39 ` [PATCH 0/7] UFFD write-tracking migration/snapshots no-reply

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.