[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH COLO-Frame v6 26/31] COLO: Improve checkpoint effici
From: |
zhanghailiang |
Subject: |
[Qemu-devel] [PATCH COLO-Frame v6 26/31] COLO: Improve checkpoint efficiency by do additional periodic checkpoint |
Date: |
Thu, 18 Jun 2015 16:58:50 +0800 |
Besides normal checkpoint which according to the result of net packets
comparing, We do additional checkpoint periodically, it will reduce the number
of dirty pages when do one checkpoint, if we don't do checkpoint for a long
time (This is a special case when the net packets is always consistent).
Signed-off-by: zhanghailiang <address@hidden>
Signed-off-by: Yang Hongyang <address@hidden>
---
migration/colo.c | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/migration/colo.c b/migration/colo.c
index cf7a6e1..b11ed7b 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -10,6 +10,7 @@
* later. See the COPYING file in the top-level directory.
*/
+#include "qemu/timer.h"
#include "sysemu/sysemu.h"
#include "migration/migration-colo.h"
#include "trace.h"
@@ -25,6 +26,13 @@
*/
#define CHECKPOINT_MIN_PERIOD 100 /* unit: ms */
+/*
+ * force checkpoint timer: unit ms
+ * this is large because COLO checkpoint will mostly depend on
+ * COLO compare module.
+ */
+#define CHECKPOINT_MAX_PEROID 10000
+
enum {
COLO_CHECPOINT_READY = 0x46,
@@ -343,14 +351,7 @@ static void *colo_thread(void *opaque)
proxy_checkpoint_req = colo_proxy_compare();
if (proxy_checkpoint_req < 0) {
goto out;
- } else if (!proxy_checkpoint_req) {
- /*
- * No checkpoint is needed, wait for 1ms and then
- * check if we need checkpoint again
- */
- g_usleep(1000);
- continue;
- } else {
+ } else if (proxy_checkpoint_req) {
int64_t interval;
current_time = qemu_clock_get_ms(QEMU_CLOCK_HOST);
@@ -359,8 +360,20 @@ static void *colo_thread(void *opaque)
/* Limit the min time between two checkpoint */
g_usleep((1000*(CHECKPOINT_MIN_PERIOD - interval)));
}
+ goto do_checkpoint;
+ }
+
+ /*
+ * No proxy checkpoint is request, wait for 100ms
+ * and then check if we need checkpoint again.
+ */
+ current_time = qemu_clock_get_ms(QEMU_CLOCK_HOST);
+ if (current_time - checkpoint_time < CHECKPOINT_MAX_PEROID) {
+ g_usleep(100000);
+ continue;
}
+do_checkpoint:
/* start a colo checkpoint */
if (colo_do_checkpoint_transaction(s, colo_control)) {
goto out;
--
1.7.12.4
- [Qemu-devel] [PATCH COLO-Frame v6 07/31] COLO: Add a new RunState RUN_STATE_COLO, (continued)
- [Qemu-devel] [PATCH COLO-Frame v6 07/31] COLO: Add a new RunState RUN_STATE_COLO, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 08/31] QEMUSizedBuffer: Introduce two help functions for qsb, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 11/31] COLO VMstate: Load VM state into qsb before restore it, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 15/31] COLO failover: Implement COLO primary/secondary vm failover work, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 02/31] migration: Introduce capability 'colo' to migration, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 14/31] COLO failover: Introduce a new command to trigger a failover, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 17/31] COLO failover: Don't do failover during loading VM's state, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 21/31] COLO NIC: Implement colo nic device interface configure(), zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 24/31] COLO: Handle nfnetlink message from proxy module, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 19/31] COLO NIC: Init/remove colo nic devices when add/cleanup tap devices, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 26/31] COLO: Improve checkpoint efficiency by do additional periodic checkpoint,
zhanghailiang <=
- [Qemu-devel] [PATCH COLO-Frame v6 25/31] COLO: Do checkpoint according to the result of packets comparation, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 20/31] tap: Make launch_script() public, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 16/31] qmp event: Add event notification for COLO error, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 22/31] COLO NIC : Implement colo nic init/destroy function, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 29/31] COLO: Disable qdev hotplug when VM is in COLO mode, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 31/31] COLO: Add block replication into colo process, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 28/31] COLO NIC: Implement NIC checkpoint and failover, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 18/31] COLO: Add new command parameter 'colo_nicname' 'colo_script' for net, zhanghailiang, 2015/06/18
- [Qemu-devel] [PATCH COLO-Frame v6 30/31] COLO: Implement shutdown checkpoint, zhanghailiang, 2015/06/18