@@ -307,10 +307,20 @@ curl --unix-socket /tmp/firecracker.socket -i \
307307
308308** Prerequisites** : The microVM is ` Paused ` .
309309
310- * Note* : On a fresh microVM, ` track_dirty_pages ` field should be set to ` true ` ,
311- when configuring the ` /machine-config ` resource, while on a snapshot loaded
312- microVM, ` enable_diff_snapshots ` from ` PUT /snapshot/load ` request body, should
313- be set.
310+ * Note* : Diff snapshots come in two flavor. If ` track_dirty_pages ` was set to
311+ ` true ` when configuring the ` /machine-config ` resource or when restoring from a
312+ snapshot via ` /snapshot/load ` , Firecracker will use KVM's dirty page log runtime
313+ functionality to ensure the diff snapshot only contains exactly pages that were
314+ written to since boot / snapshot restoration. If ` track_dirty_pages ` is not
315+ enabled, Firecracker will instead over-approximate the set of pages to include
316+ in the snapshot by instead considering all pages that were _ accessed_ during the
317+ VM's lifetime. This potentially results in bigger memory files (although they
318+ are still sparse), but avoids the runtime overhead of dirty page logging.
319+
320+ Without dirty page tracking enabled, Firecracker uses the
321+ [ ` mincore(2) ` ] [ man mincore ] syscall to determine which pages to include in the
322+ snapshot. As such, this mode of snapshot taking will only work _ if swap is
323+ disabled_ , as mincore will not consider pages written to swap to be "in core".
314324
315325** Effects** :
316326
@@ -626,3 +636,5 @@ the compatibility table reported below:
626636For example, a snapshot taken on a m6i.metal host running a 5.10 host kernel can
627637be restored on a different m6i.metal host running a 6.1 host kernel (but not
628638vice versa), but could not be restored on a c5n.metal host.
639+
640+ [ man mincore ] : https://man7.org/linux/man-pages/man2/mincore.2.html
0 commit comments