From a0a3fd60f66bfdef38da835e7382b0bfbe05bafc Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Thu, 28 May 2009 15:22:57 -0400 Subject: add non-arbitrary migration stop condition Currently, we're entering migration's stage 3 when a treshold of 10 pages remain to be transferred in the system. This has hurt some users. However, any proposed threshold is arbitrary by nature, and would only shift the annoyance. The proposal of this patch is to define a max_downtime variable, which represents the maximum downtime a migration user is willing to suffer. Then, based on the bandwidth of last iteration, we calculate how much data we can transfer in such a window of time. Whenever we reach that value (or lower), we know is safe to enter stage3. This has largely improved the situation for me. On localhost migrations, where one would expect things to go as quickly as me running away from the duty of writting software for windows, a kernel compile was enough to get the migration stuck. It takes 20 ~ 30 iterations now. Signed-off-by: Glauber Costa Signed-off-by: Anthony Liguori --- migration.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'migration.h') diff --git a/migration.h b/migration.h index 696618da06..0596f24636 100644 --- a/migration.h +++ b/migration.h @@ -55,6 +55,8 @@ void do_migrate_cancel(Monitor *mon); void do_migrate_set_speed(Monitor *mon, const char *value); +uint64_t migrate_max_downtime(void); + void do_info_migrate(Monitor *mon); int exec_start_incoming_migration(const char *host_port); -- cgit v1.2.1