qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC V1 2/7] migration: skip dirty memory tracking for cpr


From: Steve Sistare
Subject: [RFC V1 2/7] migration: skip dirty memory tracking for cpr
Date: Fri, 12 Jul 2024 07:02:06 -0700

CPR preserves memory in place, so there is no need to track dirty memory.
By skipping it, CPR can support devices that do not support tracking.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
---
 system/memory.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/system/memory.c b/system/memory.c
index b7548bf112..aef584e638 100644
--- a/system/memory.c
+++ b/system/memory.c
@@ -27,6 +27,7 @@
 
 #include "exec/memory-internal.h"
 #include "exec/ram_addr.h"
+#include "migration/misc.h"
 #include "sysemu/kvm.h"
 #include "sysemu/runstate.h"
 #include "sysemu/tcg.h"
@@ -2947,6 +2948,11 @@ bool memory_global_dirty_log_start(unsigned int flags, 
Error **errp)
 
     assert(flags && !(flags & (~GLOBAL_DIRTY_MASK)));
 
+    /* CPR preserves memory in place, so no need to track dirty memory */
+    if (migrate_mode() != MIG_MODE_NORMAL) {
+        return true;
+    }
+
     if (vmstate_change) {
         /* If there is postponed stop(), operate on it first */
         postponed_stop_flags &= ~flags;
@@ -3021,6 +3027,11 @@ static void memory_vm_change_state_handler(void *opaque, 
bool running,
 
 void memory_global_dirty_log_stop(unsigned int flags)
 {
+    /* CPR preserves memory in place, so no need to track dirty memory */
+    if (migrate_mode() != MIG_MODE_NORMAL) {
+        return;
+    }
+
     if (!runstate_is_running()) {
         /* Postpone the dirty log stop, e.g., to when VM starts again */
         if (vmstate_change) {
-- 
2.39.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]