[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V2 8/8] migration/colo: Only flush ram cache while do checkpoint
From: |
zhanghailiang |
Subject: |
[PATCH V2 8/8] migration/colo: Only flush ram cache while do checkpoint |
Date: |
Mon, 24 Feb 2020 14:54:14 +0800 |
After add migrating ram backgroud, we will call ram_load
for this process, but we should not flush ram cache during
this process. Move the flush action to the right place.
Signed-off-by: zhanghailiang <address@hidden>
---
migration/colo.c | 1 +
migration/ram.c | 5 +----
migration/ram.h | 1 +
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/migration/colo.c b/migration/colo.c
index c36d94072f..18df8289f8 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -799,6 +799,7 @@ static void
colo_incoming_process_checkpoint(MigrationIncomingState *mis,
qemu_mutex_lock_iothread();
vmstate_loading = true;
+ colo_flush_ram_cache();
ret = qemu_load_device_state(fb);
if (ret < 0) {
error_setg(errp, "COLO: load device state failed");
diff --git a/migration/ram.c b/migration/ram.c
index 1b3f423351..7bc841d14f 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3305,7 +3305,7 @@ static bool postcopy_is_running(void)
* Flush content of RAM cache into SVM's memory.
* Only flush the pages that be dirtied by PVM or SVM or both.
*/
-static void colo_flush_ram_cache(void)
+void colo_flush_ram_cache(void)
{
RAMBlock *block = NULL;
void *dst_host;
@@ -3576,9 +3576,6 @@ static int ram_load(QEMUFile *f, void *opaque, int
version_id)
}
trace_ram_load_complete(ret, seq_iter);
- if (!ret && migration_incoming_in_colo_state()) {
- colo_flush_ram_cache();
- }
return ret;
}
diff --git a/migration/ram.h b/migration/ram.h
index 5ceaff7cb4..ae14341482 100644
--- a/migration/ram.h
+++ b/migration/ram.h
@@ -67,5 +67,6 @@ int ram_dirty_bitmap_reload(MigrationState *s, RAMBlock *rb);
int colo_init_ram_cache(void);
void colo_release_ram_cache(void);
void colo_incoming_start_dirty_log(void);
+void colo_flush_ram_cache(void);
#endif
--
2.21.0
- [PATCH V2 0/8] Optimize VM's downtime while do checkpoint in COLO, zhanghailiang, 2020/02/24
- [PATCH V2 1/8] migration: fix COLO broken caused by a previous commit, zhanghailiang, 2020/02/24
- [PATCH V2 5/8] ram/colo: only record bitmap of dirty pages in COLO stage, zhanghailiang, 2020/02/24
- [PATCH V2 3/8] savevm: Don't call colo_init_ram_cache twice, zhanghailiang, 2020/02/24
- [PATCH V2 2/8] migration/colo: wrap incoming checkpoint process into new helper, zhanghailiang, 2020/02/24
- [PATCH V2 6/8] migration: recognize COLO as part of activating process, zhanghailiang, 2020/02/24
- [PATCH V2 8/8] migration/colo: Only flush ram cache while do checkpoint,
zhanghailiang <=
- [PATCH V2 7/8] COLO: Migrate dirty pages during the gap of checkpointing, zhanghailiang, 2020/02/24
- [PATCH V2 4/8] COLO: Optimize memory back-up process, zhanghailiang, 2020/02/24