migration/colo: Optimize COLO framework code
v3 cover migration/colo: Optimize COLO framework code
From: Zhang Chen <[email protected]>
This series optimize some code of COLO, please review.
Zhang Chen (3):
migration/colo: Optimize COLO boot code path migration/colo: Update checkpoint time lately migration/migration.c: Remove MIGRATION_STATUS_ACTIVE in
migration_iteration_finish
migration/colo.c | 7 ++----- migration/migration.c | 12 +++++------- 2 files changed, 7 insertions(+), 12 deletions(-)
Signature · 1 line
2.17.1
PATCH v3 1/3 migration/colo: Optimize COLO boot code path
From: Zhang Chen <[email protected]>
No need to reuse MIGRATION_STATUS_ACTIVE boot COLO.
--- migration/colo.c | 2 -- migration/migration.c | 17 ++++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-)
migration/colo.c +0 -2
@@ -670,8 +670,6 @@ void migrate_start_colo_process(MigrationState *s) colo_checkpoint_notify, s);qemu_sem_init (&s->colo_exit_sem,0 ); -migrate_set_state (&s->state,MIGRATION_STATUS_ACTIVE , -MIGRATION_STATUS_COLO );colo_process_checkpoint (s);qemu_mutex_lock_iothread (); }
migration/migration.c +10 -7
@@ -2972,7 +2972,10 @@ static void migration_completion(MigrationState *s) goto fail_invalidate; } -if (!migrate_colo_enabled ()) { +if (migrate_colo_enabled ()) { +migrate_set_state (&s->state, current_active_state, +MIGRATION_STATUS_COLO ); + }else {migrate_set_state (&s->state, current_active_state,MIGRATION_STATUS_COMPLETED ); }
@@ -3304,12 +3307,7 @@ static void migration_iteration_finish(MigrationState *s)migration_calculate_complete (s);runstate_set (RUN_STATE_POSTMIGRATE );break ; - -case MIGRATION_STATUS_ACTIVE : -/* -* We should really assert here, but since it's during -* migration, let's try to reduce the usage of assertions. -*/ +case MIGRATION_STATUS_COLO :if (!migrate_colo_enabled ()) {error_report ("%s: critical error: calling COLO code without " "COLO enabled" , __func__);
@@ -3321,6 +3319,11 @@ static void migration_iteration_finish(MigrationState *s)*/ s->vm_was_running = true;/* Fallthrough */ +case MIGRATION_STATUS_ACTIVE : +/* +* We should really assert here, but since it's during +* migration, let's try to reduce the usage of assertions. +*/ case MIGRATION_STATUS_FAILED :case MIGRATION_STATUS_CANCELLED :case MIGRATION_STATUS_CANCELLING :
Signature · 1 line
2.17.1
Re: [PATCH V3 1/3] migration/colo: Optimize COLO boot code path
Quoted 7 lines · On Mon, 8 Jun 2020 03:46:09 +0800 Zhang Chen <[email protected] > wrote:
From: Zhang Chen <[email protected]>
No need to reuse
MIGRATION_STATUS_ACTIVEboot COLO.Signed-off-by Zhang Chen <[email protected]>Reviewed-by zhanghailiang <[email protected]>---
Looks good and works well in my tests.
Regards,
Lukas Straub
PATCH v3 2/3 migration/colo: Update checkpoint time lately
In reply to Zhang ChenFrom: Zhang Chen <[email protected]>
Previous operation(like vm_start and replication_start_all) will consume extra time for first forced synchronization, so reduce it in this patch.
--- migration/colo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
migration/colo.c +2 -3
@@ -532,7 +532,6 @@ static void colo_process_checkpoint(MigrationState *s) {QIOChannelBuffer *bioc;QEMUFile *fb =NULL ; -int64_t current_time =qemu_clock_get_ms (QEMU_CLOCK_HOST );Error *local_err =NULL ;int ret;
@@ -581,8 +580,8 @@ static void colo_process_checkpoint(MigrationState *s)qemu_mutex_unlock_iothread ();trace_colo_vm_state_change ("stop" ,"run" ); -timer_mod (s->colo_delay_timer, - current_time + s->parameters.x_checkpoint_delay); +timer_mod (s->colo_delay_timer,qemu_clock_get_ms (QEMU_CLOCK_HOST ) + + s->parameters.x_checkpoint_delay);while (s->state ==MIGRATION_STATUS_COLO ) {if (failover_get_state () !=FAILOVER_STATUS_NONE ) {
Signature · 1 line
2.17.1
PATCH v3 3/3 migration/migration.c: Remove MIGRATION_STATUS_ACTIVE in migration_iteration_finish
In reply to Zhang ChenFrom: Zhang Chen <[email protected]>
MIGRATION_STATUS_ACTIVE is invalid here, handle it by default case.
--- migration/migration.c | 5 ----- 1 file changed, 5 deletions(-)
migration/migration.c +0 -5
@@ -3319,11 +3319,6 @@ static void migration_iteration_finish(MigrationState *s)*/ s->vm_was_running = true;/* Fallthrough */ -case MIGRATION_STATUS_ACTIVE : -/* -* We should really assert here, but since it's during -* migration, let's try to reduce the usage of assertions. -*/ case MIGRATION_STATUS_FAILED :case MIGRATION_STATUS_CANCELLED :case MIGRATION_STATUS_CANCELLING :
Signature · 1 line
2.17.1
Re: [PATCH V3 3/3] migration/migration.c: Remove MIGRATION_STATUS_ACTIVE in migration_iteration_finish
Quoted 7 lines · On Mon, 8 Jun 2020 03:46:11 +0800 Zhang Chen <[email protected] > wrote:
From: Zhang Chen <[email protected]>
MIGRATION_STATUS_ACTIVEis invalid here, handle it by default case.Suggested-by Lukas Straub <[email protected]>Signed-off-by Zhang Chen <[email protected]>---
Looks good and works well in my tests.
Regards,
Lukas Straub
Hi Dave,
Any comments for this series?
Thanks
Zhang Chen
Quoted 25 lines
-----Original Message-----
From: Zhang, Chen <[email protected]>
Sent: Monday, June 8, 2020 3:46 AM
To: Dr . David Alan Gilbert <[email protected]>; qemu-dev <qemu- [email protected]>
Cc: Zhang Chen <[email protected]>; Zhanghailiang <[email protected]>; Zhang, Chen <[email protected]>
Subject: [PATCH V3 0/3] migration/colo: Optimize COLO framework codeFrom: Zhang Chen <[email protected]>
This series optimize some code of COLO, please review.
Zhang Chen (3):
migration/colo: Optimize COLO boot code path migration/colo: Update checkpoint time latelymigration/migration.c: RemoveMIGRATION_STATUS_ACTIVEin
migration_iteration_finishmigration/colo.c | 7 ++----- migration/migration.c | 12 +++++------- 2 files changed, 7 insertions(+), 12 deletions(-)--
2.17.1
Quoted 2 lines · * Zhang, Chen ([email protected]) wrote:
Hi Dave,
I think it's OK; I guess Zhanghailiang is going to do a pull for it? One thought about the change of use of MIGRATION_STATUS_ACTIVE; I think it's OK at the moment - but the migration states and the way they change becomes part of the API - changing which states we use can confuse management applications; since there's no libvirt support, I'll leave it to Zhanghailiang to know if that's OK.
Dave
Quoted 30 lines
Thanks
Zhang ChenQuoted 25 lines
-----Original Message-----
From: Zhang, Chen <[email protected]>
Sent: Monday, June 8, 2020 3:46 AM
To: Dr . David Alan Gilbert <[email protected]>; qemu-dev <qemu- [email protected]>
Cc: Zhang Chen <[email protected]>; Zhanghailiang <[email protected]>; Zhang, Chen <[email protected]>
Subject: [PATCH V3 0/3] migration/colo: Optimize COLO framework codeFrom: Zhang Chen <[email protected]>
This series optimize some code of COLO, please review.
Zhang Chen (3):
migration/colo: Optimize COLO boot code path migration/colo: Update checkpoint time latelymigration/migration.c: RemoveMIGRATION_STATUS_ACTIVEin
migration_iteration_finishmigration/colo.c | 7 ++----- migration/migration.c | 12 +++++------- 2 files changed, 7 insertions(+), 12 deletions(-)--
2.17.1
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Quoted 14 lines
-----Original Message-----
From: Dr. David Alan Gilbert <[email protected]>
Sent: Wednesday, June 17, 2020 8:26 PM
To: Zhang, Chen <[email protected]>
Cc: qemu-dev <[email protected]>; Zhang Chen <[email protected]>; Zhanghailiang <[email protected]>
Subject: Re: [PATCH V3 0/3] migration/colo: Optimize COLO framework codeQuoted 2 lines · * Zhang, Chen ([email protected]) wrote:
Hi Dave,
Quoted 6 lines
I think it's OK; I guess Zhanghailiang is going to do a pull for it? One thought about the change of use of
MIGRATION_STATUS_ACTIVE; I think it's OK at the moment - but the migration states and the way they change becomes part of the API - changing which states we use can confuse management applications; since there's no libvirt support, I'll leave it to Zhanghailiang to know if that's OK.
Hi Hailiang/Dave,
Current upstream libvirt can't support COLO, it looks no new issue for normal migration process. For the future, new COLO migration status is good for COLO enable work on libvirt and upper layer.
Thanks
Zhang Chen
Quoted 37 lines
Dave
Quoted 11 lines
Thanks
Zhang ChenQuoted 7 lines
-----Original Message-----
From: Zhang, Chen <[email protected]>
Sent: Monday, June 8, 2020 3:46 AM
To: Dr . David Alan Gilbert <[email protected]>; qemu-dev <qemu- [email protected]>
Cc: Zhang Chen <[email protected]>; Zhanghailiang <[email protected]>; Zhang, ChenQuoted 12 lines
Quoted 12 lines
Subject: [PATCH V3 0/3] migration/colo: Optimize COLO framework code
From: Zhang Chen <[email protected]>
This series optimize some code of COLO, please review.
Zhang Chen (3):
migration/colo: Optimize COLO boot code path migration/colo: Update checkpoint time latelymigration/migration.c: RemoveMIGRATION_STATUS_ACTIVEin
migration_iteration_finishQuoted 7 lines
Quoted 6 lines
migration/colo.c | 7 ++----- migration/migration.c | 12 +++++------- 2 files changed, 7 insertions(+), 12 deletions(-)--
2.17.1--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Hi Hailiang/Dave,
No news for a while, any comments?
Thanks
Zhang Chen
Quoted 81 lines
-----Original Message-----
From: Qemu-devel <qemu-devel- [email protected]> On Behalf Of Zhang, Chen
Sent: Monday, June 22, 2020 2:53 PM
To: Dr. David Alan Gilbert <[email protected]>
Cc: Zhanghailiang <[email protected]>; qemu-dev <qemu- [email protected]>; Zhang Chen <[email protected]>
Subject: RE: [PATCH V3 0/3] migration/colo: Optimize COLO framework codeQuoted 6 lines
-----Original Message-----
From: Dr. David Alan Gilbert <[email protected]>
Sent: Wednesday, June 17, 2020 8:26 PM
To: Zhang, Chen <[email protected]>
Cc: qemu-dev <[email protected]>; Zhang Chen <[email protected]>; ZhanghailiangQuoted 7 lines
Subject: Re: [PATCH V3 0/3] migration/colo: Optimize COLO framework code
Quoted 2 lines · * Zhang, Chen ([email protected]) wrote:
Hi Dave,
Quoted 6 lines
I think it's OK; I guess Zhanghailiang is going to do a pull for it? One thought about the change of use of
MIGRATION_STATUS_ACTIVE; I think it's OK at the moment - but the migration states and the way they change becomes part of the API - changing which states we use can confuse management applications; since there's no libvirt support, I'll leave it to Zhanghailiang to know if that's OK.Hi Hailiang/Dave,
Current upstream libvirt can't support COLO, it looks no new issue for normal migration process.
For the future, new COLO migration status is good for COLO enable work on libvirt and upper layer.Thanks
Zhang ChenQuoted 38 lines
Dave
Quoted 11 lines
Thanks
Zhang ChenQuoted 7 lines
-----Original Message-----
From: Zhang, Chen <[email protected]>
Sent: Monday, June 8, 2020 3:46 AM
To: Dr . David Alan Gilbert <[email protected]>; qemu-dev <qemu- [email protected]>
Cc: Zhang Chen <[email protected]>; Zhanghailiang <[email protected]>; Zhang, ChenQuoted 13 lines
Quoted 13 lines
Subject: [PATCH V3 0/3] migration/colo: Optimize COLO framework code
From: Zhang Chen <[email protected]>
This series optimize some code of COLO, please review.
Zhang Chen (3):
migration/colo: Optimize COLO boot code path migration/colo: Update checkpoint time latelymigration/migration.c: RemoveMIGRATION_STATUS_ACTIVEin
migration_iteration_finishQuoted 7 lines
Quoted 6 lines
migration/colo.c | 7 ++----- migration/migration.c | 12 +++++------- 2 files changed, 7 insertions(+), 12 deletions(-)--
2.17.1--
Dr. David Alan Gilbert / [email protected] / Manchester, UK