From: Aadeshveer Singh <aadeshveer07@gmail.com>
To: qemu-devel@nongnu.org
Cc: peterx@redhat.com, farosas@suse.de, pbonzini@redhat.com,
philmd@mailo.com, lvivier@redhat.com, ayoub@saferwall.com,
pierrick.bouvier@oss.qualcomm.com,
Aadeshveer Singh <aadeshveer07@gmail.com>
Subject: [PATCH v4 11/11] docs/migration: Add documentation for fast snapshot load feature
Date: Sat, 1 Aug 2026 08:06:28 +0530 [thread overview]
Message-ID: <20260801023628.22665-12-aadeshveer07@gmail.com> (raw)
In-Reply-To: <20260801023628.22665-1-aadeshveer07@gmail.com>
Add documenatation for fast snapshot load covering an overview, the
architecture, usage and limitations.
Signed-off-by: Aadeshveer Singh <aadeshveer07@gmail.com>
---
docs/devel/migration/fast-snapshot-load.rst | 82 +++++++++++++++++++++
docs/devel/migration/features.rst | 1 +
2 files changed, 83 insertions(+)
create mode 100644 docs/devel/migration/fast-snapshot-load.rst
diff --git a/docs/devel/migration/fast-snapshot-load.rst b/docs/devel/migration/fast-snapshot-load.rst
new file mode 100644
index 0000000000..fe2361d6fe
--- /dev/null
+++ b/docs/devel/migration/fast-snapshot-load.rst
@@ -0,0 +1,82 @@
+==================
+Fast Snapshot Load
+==================
+
+Overview
+========
+Fast snapshot load is an extension of the postcopy migration feature
+to disk loads.
+
+Unlike a usual snapshot load, which requires all VM data (RAM as well
+as device states) to be loaded into host RAM from the snapshot file
+for the guest to run, fast snapshot load uses postcopy infrastructure
+to load in only the required device states and allows RAM pages to
+be loaded after the guest starts execution. The idea is to start the
+guest and serve its page faults on the go, reducing the perceived
+resume time for large snapshots.
+
+Architecture
+============
+This feature combines postcopy migration and mapped-ram capabilities
+to load RAM pages on demand. It is done by catching guest faults using
+Linux ``userfaultfd`` and loading the page by calculating the offset
+of its location in the snapshot file using mapped-ram capabilities.
+
+Fault Thread
+------------
+The fault thread uses Linux ``userfaultfd`` to catch page faults caused
+by guest and directly load the page from the snapshot file. It is
+very similar to network postcopy fault thread, with primary difference
+being it loads pages directly by reading from the snapshot file.
+
+Eager Thread
+------------
+Eager thread iterates over all pages in RAM and loads each page not
+yet loaded by fault thread. It is required as unlike network postcopy
+where majority of RAM has already been loaded via precopy, here entire
+RAM is waiting to be loaded. If there is no eager loading thread each
+page will only be loaded when it is required by guest. In case there
+are some background pages that are never/rarely accessed by guest,
+the system will be locked in migration state indefinitely.
+
+Synchronization
+---------------
+In order to make sure both of these threads do not load the same page
+twice potentially overwriting and corrupting user RAM, a bitmap is
+used (``RAMBlock->pending_bmap``) which tracks the pages claimed to
+be loaded by threads. This prevents race condition when one thread
+is loading the page and other one tries to do the same.
+
+Usage
+=====
+
+Simply enable ``mapped-ram`` and ``postcopy-ram`` capabilities on
+the destination:
+
+.. code-block:: text
+
+ migrate_set_capability mapped-ram on
+ migrate_set_capability postcopy-ram on
+
+Use a ``file:`` URI for migration:
+
+.. code-block:: text
+
+ migrate_incoming file:/path/to/snapshot/file
+
+Limitations
+===========
+
+ - Multifd
+ Fast snapshot load is currently incompatible with ``multifd``
+ capability. While ``mapped-ram`` allows for parallel disk I/O,
+ coupling it with ``postcopy`` capability requires additional
+ infrastructure.
+
+ - Host OS support
+ Because this feautre essentially depends on ``userfaultfd``
+ to trap page faults, it is supported only on Linux hosts.
+
+ - vhost-user
+ Fast snapshot load does not currently support ``vhost-user``
+ backends.
diff --git a/docs/devel/migration/features.rst b/docs/devel/migration/features.rst
index 9aef79e7fa..23c2a93173 100644
--- a/docs/devel/migration/features.rst
+++ b/docs/devel/migration/features.rst
@@ -11,6 +11,7 @@ Migration has plenty of features to support different use cases.
vfio
virtio
mapped-ram
+ fast-snapshot-load
CPR
qpl-compression
uadk-compression
--
2.55.0
next prev parent reply other threads:[~2026-08-01 2:38 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-01 2:36 [PATCH v4 00/11] migration: fast snapshot load Aadeshveer Singh
2026-08-01 2:36 ` [PATCH v4 01/11] migration: Propagate error in postcopy setup functions Aadeshveer Singh
2026-08-10 15:08 ` Juraj Marcin
2026-08-01 2:36 ` [PATCH v4 02/11] migration: Extract blocktime marking helper Aadeshveer Singh
2026-08-10 15:08 ` Juraj Marcin
2026-08-01 2:36 ` [PATCH v4 03/11] migration: Rename postcopy_listen_thread_bh Aadeshveer Singh
2026-08-10 15:09 ` Juraj Marcin
2026-08-01 2:36 ` [PATCH v4 04/11] migration: Use file_bmap for RAMBlock during incoming file load Aadeshveer Singh
2026-08-10 15:09 ` Juraj Marcin
2026-08-01 2:36 ` [PATCH v4 05/11] migration: Make qemu_get_buffer_at() thread-safe Aadeshveer Singh
2026-08-10 14:14 ` Peter Xu
2026-08-10 15:10 ` Juraj Marcin
2026-08-01 2:36 ` [PATCH v4 06/11] migration: add RAMBlock field and helper for fast snapshot load Aadeshveer Singh
2026-08-10 15:12 ` Juraj Marcin
2026-08-01 2:36 ` [PATCH v4 07/11] migration: add support for fault thread to load pages from disk Aadeshveer Singh
2026-08-08 4:34 ` Aadeshveer Singh
2026-08-10 15:40 ` Peter Xu
2026-08-01 2:36 ` [PATCH v4 08/11] migration: add eager load thread and setup for fast snapshot load Aadeshveer Singh
2026-08-10 15:48 ` Juraj Marcin
2026-08-01 2:36 ` [PATCH v4 09/11] migration: update capability conflict test for postcopy-ram+mapped-ram Aadeshveer Singh
2026-08-10 15:49 ` Juraj Marcin
2026-08-10 18:23 ` Peter Xu
2026-08-01 2:36 ` [PATCH v4 10/11] migration/tests: Add test for fast snapshot load Aadeshveer Singh
2026-08-10 15:50 ` Juraj Marcin
2026-08-01 2:36 ` Aadeshveer Singh [this message]
2026-08-10 18:24 ` [PATCH v4 11/11] docs/migration: Add documentation for fast snapshot load feature Peter Xu
2026-08-10 19:02 ` [PATCH v4 00/11] migration: fast snapshot load Peter Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260801023628.22665-12-aadeshveer07@gmail.com \
--to=aadeshveer07@gmail.com \
--cc=ayoub@saferwall.com \
--cc=farosas@suse.de \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@mailo.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.