Skip to contentSkip to conversation

migration: Fix migration state update issue

PATCH In review Liang Li 3 participants 3 messages May 7, 2015

lore
Share & tools
lore

Liang Li

author
#0 lore raw

PATCH 1/1 migration: Fix migration state update issue

If live migration is very fast and can be completed in 1 second, the dirty_sync_count of MigrationState will not be updated. Then you will see "dirty sync count: 0" in qemu monitor even if the actual dirty sync count is not 0.

---
 arch_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch_init.c +1 -1
index 4c8fcee..a48f575 100644
@@ -599,8 +599,8 @@ static void migration_bitmap_sync(void)
         s->dirty_bytes_rate = s->dirty_pages_rate * TARGET_PAGE_SIZE;
         start_time = end_time;
         num_dirty_pages_period = 0;
-        s->dirty_sync_count = bitmap_sync_count;
     }
+    s->dirty_sync_count = bitmap_sync_count;
 }
 
 /**
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · * Liang Li ([email protected]) wrote:

If live migration is very fast and can be completed in 1 second, the dirty_sync_count of MigrationState will not be updated. Then you will see "dirty sync count: 0" in qemu monitor even if the actual dirty sync count is not 0.

---
 arch_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch_init.c +0 -0
index 4c8fcee..a48f575 100644

arch_init.c static void migration_bitmap_sync(void) · line 604

Quoted 7 lines
arch_init.c +1 -1
@@ -599,8 +599,8 @@ static void migration_bitmap_sync(void)
         s->dirty_bytes_rate = s->dirty_pages_rate * TARGET_PAGE_SIZE;
         start_time = end_time;
         num_dirty_pages_period = 0;
-        s->dirty_sync_count = bitmap_sync_count;
     }
+    s->dirty_sync_count = bitmap_sync_count;
 }

Yes, makes sense.
(An interesting question is why there needs to be a separate bitmap_sync_count variable that's separate from s->dirty_sync_count)

Dave

Quoted 6 lines
arch_init.c +0 -0
 /**
Signature · 1 line
1.9.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 1/1
#2 lore raw
In reply to Liang Li
Quoted 6 lines · Liang Li

If live migration is very fast and can be completed in 1 second, the dirty_sync_count of MigrationState will not be updated. Then you will see "dirty sync count: 0" in qemu monitor even if the actual dirty sync count is not 0.

Added to new pull request, thanks.

Quoted 18 lines
---
 arch_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch_init.c +1 -1
index 4c8fcee..a48f575 100644
@@ -599,8 +599,8 @@ static void migration_bitmap_sync(void)
         s->dirty_bytes_rate = s->dirty_pages_rate * TARGET_PAGE_SIZE;
         start_time = end_time;
         num_dirty_pages_period = 0;
-        s->dirty_sync_count = bitmap_sync_count;
     }
+    s->dirty_sync_count = bitmap_sync_count;
 }
 
 /**