Skip to contentSkip to conversation

Optimize COLO related codes and description

PATCH In review Zhang Chen 2 participants 10 messages Apr 26, 2019 – May 14, 2019

lore
Share & tools
lore

Zhang Chen

author
#0 lore raw

cover Optimize COLO related codes and description

From: Zhang Chen <[email protected]>

In this series we optimize codes and fix some tiny issues.

Zhang Chen (3):
migration/colo.c: Remove redundant input parameter migration/colo.h: Remove obsolete codes qemu-option.hx: Update missed parameter for colo-compare

 include/migration/colo.h  | 4 +---
 migration/colo-failover.c | 2 +-
 migration/colo.c          | 2 +-
 qemu-options.hx           | 9 ++++++---
 4 files changed, 9 insertions(+), 8 deletions(-)
Signature · 1 line
2.17.GIT
author
#1 lore raw

PATCH 1/3 migration/colo.c: Remove redundant input parameter

From: Zhang Chen <[email protected]>

The colo_do_failover no need the input parameter.

---
 include/migration/colo.h  | 2 +-
 migration/colo-failover.c | 2 +-
 migration/colo.c          | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
include/migration/colo.h +1 -1
index 99ce17aca7..ddebe0ad27 100644
@@ -37,7 +37,7 @@ bool migration_incoming_in_colo_state(void);
 COLOMode get_colo_mode(void);
 
 /* failover */
-void colo_do_failover(MigrationState *s);
+void colo_do_failover(void);
 
 void colo_checkpoint_notify(void *opaque);
 #endif
migration/colo-failover.c +1 -1
index 4854a96c92..e9ca0b4774 100644
@@ -39,7 +39,7 @@ static void colo_failover_bh(void *opaque)
         return;
     }
 
-    colo_do_failover(NULL);
+    colo_do_failover();
 }
 
 void failover_request_active(Error **errp)
migration/colo.c +1 -1
index 238a6d62c7..8c1644091f 100644
@@ -193,7 +193,7 @@ COLOMode get_colo_mode(void)
     }
 }
 
-void colo_do_failover(MigrationState *s)
+void colo_do_failover(void)
 {
     /* Make sure VM stopped while failover happened. */
     if (!colo_runstate_is_stopped()) {
Signature · 1 line
2.17.GIT
Reviewed-by on v1 1/3
#2 lore raw

Re: [Qemu-devel] [PATCH 1/3] migration/colo.c: Remove redundant input parameter

Quoted 5 lines · * Zhang Chen ([email protected]) wrote:

From: Zhang Chen <[email protected]>

The colo_do_failover no need the input parameter.

Quoted 48 lines
---
 include/migration/colo.h  | 2 +-
 migration/colo-failover.c | 2 +-
 migration/colo.c          | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
include/migration/colo.h +1 -1
index 99ce17aca7..ddebe0ad27 100644
@@ -37,7 +37,7 @@ bool migration_incoming_in_colo_state(void);
 COLOMode get_colo_mode(void);
 
 /* failover */
-void colo_do_failover(MigrationState *s);
+void colo_do_failover(void);
 
 void colo_checkpoint_notify(void *opaque);
 #endif
migration/colo-failover.c +1 -1
index 4854a96c92..e9ca0b4774 100644
@@ -39,7 +39,7 @@ static void colo_failover_bh(void *opaque)
         return;
     }
 
-    colo_do_failover(NULL);
+    colo_do_failover();
 }
 
 void failover_request_active(Error **errp)
migration/colo.c +1 -1
index 238a6d62c7..8c1644091f 100644
@@ -193,7 +193,7 @@ COLOMode get_colo_mode(void)
     }
 }
 
-void colo_do_failover(MigrationState *s)
+void colo_do_failover(void)
 {
     /* Make sure VM stopped while failover happened. */
     if (!colo_runstate_is_stopped()) {
Signature · 1 line
2.17.GIT

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

author
#3 lore raw

PATCH 2/3 migration/colo.h: Remove obsolete codes

In reply to Zhang Chen

From: Zhang Chen <[email protected]>

---
 include/migration/colo.h | 2 --
 1 file changed, 2 deletions(-)
include/migration/colo.h +0 -2
index ddebe0ad27..f6fbe23ec9 100644
@@ -22,8 +22,6 @@ enum colo_event {
     COLO_EVENT_FAILOVER,
 };
 
-void colo_info_init(void);
-
 void migrate_start_colo_process(MigrationState *s);
 bool migration_in_colo_state(void);
 
Signature · 1 line
2.17.GIT
Reviewed-by on v1 2/3
#4 lore raw

Re: [Qemu-devel] [PATCH 2/3] migration/colo.h: Remove obsolete codes

Quoted 3 lines · * Zhang Chen ([email protected]) wrote:

From: Zhang Chen <[email protected]>

Quoted 20 lines
---
 include/migration/colo.h | 2 --
 1 file changed, 2 deletions(-)
include/migration/colo.h +0 -2
index ddebe0ad27..f6fbe23ec9 100644
@@ -22,8 +22,6 @@ enum colo_event {
     COLO_EVENT_FAILOVER,
 };
 
-void colo_info_init(void);
-
 void migrate_start_colo_process(MigrationState *s);
 bool migration_in_colo_state(void);
 
Signature · 1 line
2.17.GIT

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

author
#5 lore raw

PATCH 3/3 qemu-option.hx: Update missed parameter for colo-compare

In reply to Zhang Chen

From: Zhang Chen <[email protected]>

We missed the iothread related args in this file.
This patch is used to fix this issue.

---
 qemu-options.hx | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
qemu-options.hx +6 -3
index 08749a3391..a4500c99ef 100644
@@ -4420,13 +4420,15 @@ Dump the network traffic on netdev @var{dev} to the file specified by
 The file format is libpcap, so it can be analyzed with tools such as tcpdump
 or Wireshark.
 
-@item -object colo-compare,id=@var{id},primary_in=@var{chardevid},secondary_in=@var{chardevid},outdev=@var{chardevid}[,vnet_hdr_support]
+@item -object colo-compare,id=@var{id},primary_in=@var{chardevid},secondary_in=@var{chardevid},outdev=@var{chardevid},iothread=@var{id}[,vnet_hdr_support]
 
 Colo-compare gets packet from primary_in@var{chardevid} and secondary_in@var{chardevid}, than compare primary packet with
 secondary packet. If the packets are same, we will output primary
 packet to outdev@var{chardevid}, else we will notify colo-frame
 do checkpoint and send primary packet to outdev@var{chardevid}.
-if it has the vnet_hdr_support flag, colo compare will send/recv packet with vnet_hdr_len.
+In order to improve efficiency, we need to put the task of comparison
+in another thread. If it has the vnet_hdr_support flag, colo compare
+will send/recv packet with vnet_hdr_len.
 
 we must use it with the help of filter-mirror and filter-redirector.
 
@@ -4441,10 +4443,11 @@ primary:
 -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
 -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
 -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
+-object iothread,id=iothread1
 -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
 -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
 -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
--object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0
+-object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,iothread=iothread1
 
 secondary:
 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
Signature · 1 line
2.17.GIT
Reviewed-by on v1 3/3
#6 lore raw

Re: [Qemu-devel] [PATCH 3/3] qemu-option.hx: Update missed parameter for colo-compare

Quoted 6 lines · * Zhang Chen ([email protected]) wrote:

From: Zhang Chen <[email protected]>

We missed the iothread related args in this file.
This patch is used to fix this issue.

OK.

Quoted 42 lines
---
 qemu-options.hx | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
qemu-options.hx +6 -3
index 08749a3391..a4500c99ef 100644
@@ -4420,13 +4420,15 @@ Dump the network traffic on netdev @var{dev} to the file specified by
 The file format is libpcap, so it can be analyzed with tools such as tcpdump
 or Wireshark.
 
-@item -object colo-compare,id=@var{id},primary_in=@var{chardevid},secondary_in=@var{chardevid},outdev=@var{chardevid}[,vnet_hdr_support]
+@item -object colo-compare,id=@var{id},primary_in=@var{chardevid},secondary_in=@var{chardevid},outdev=@var{chardevid},iothread=@var{id}[,vnet_hdr_support]
 
 Colo-compare gets packet from primary_in@var{chardevid} and secondary_in@var{chardevid}, than compare primary packet with
 secondary packet. If the packets are same, we will output primary
 packet to outdev@var{chardevid}, else we will notify colo-frame
 do checkpoint and send primary packet to outdev@var{chardevid}.
-if it has the vnet_hdr_support flag, colo compare will send/recv packet with vnet_hdr_len.
+In order to improve efficiency, we need to put the task of comparison
+in another thread. If it has the vnet_hdr_support flag, colo compare
+will send/recv packet with vnet_hdr_len.
 
 we must use it with the help of filter-mirror and filter-redirector.
 
@@ -4441,10 +4443,11 @@ primary:
 -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
 -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
 -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
+-object iothread,id=iothread1
 -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
 -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
 -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
--object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0
+-object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,iothread=iothread1
 
 secondary:
 -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
Signature · 1 line
2.17.GIT

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

#7 lore raw
In reply to Zhang Chen

Hi Dave,

I noticed that you have reviewed all the patches in this series, can you queue it?

Thanks
Zhang Chen

Quoted 27 lines

-----Original Message-----
From: Zhang, Chen
Sent: Friday, April 26, 2019 5:07 PM
To: Laurent Vivier <[email protected]>; Dr. David Alan Gilbert <[email protected]>; Juan Quintela <[email protected]>; zhanghailiang <[email protected]>; Markus Armbruster <[email protected]>; qemu-dev <[email protected]>
Cc: Zhang Chen <[email protected]>; Zhang, Chen <[email protected]>
Subject: [PATCH 0/3] Optimize COLO related codes and description

From: Zhang Chen <[email protected]>

In this series we optimize codes and fix some tiny issues.

Zhang Chen (3):
migration/colo.c: Remove redundant input parameter migration/colo.h: Remove obsolete codes qemu-option.hx: Update missed parameter for colo-compare

 include/migration/colo.h  | 4 +---
 migration/colo-failover.c | 2 +-
 migration/colo.c          | 2 +-
 qemu-options.hx           | 9 ++++++---
 4 files changed, 9 insertions(+), 8 deletions(-)

--
2.17.GIT

#8 lore raw
Quoted 3 lines · * Zhang, Chen ([email protected]) wrote:

Hi Dave,

I noticed that you have reviewed all the patches in this series, can you queue it?

Yes, I'm about to start a migration pull now.

Dave

Quoted 32 lines

Thanks
Zhang Chen

Quoted 27 lines

-----Original Message-----
From: Zhang, Chen
Sent: Friday, April 26, 2019 5:07 PM
To: Laurent Vivier <[email protected]>; Dr. David Alan Gilbert <[email protected]>; Juan Quintela <[email protected]>; zhanghailiang <[email protected]>; Markus Armbruster <[email protected]>; qemu-dev <[email protected]>
Cc: Zhang Chen <[email protected]>; Zhang, Chen <[email protected]>
Subject: [PATCH 0/3] Optimize COLO related codes and description

From: Zhang Chen <[email protected]>

In this series we optimize codes and fix some tiny issues.

Zhang Chen (3):
migration/colo.c: Remove redundant input parameter migration/colo.h: Remove obsolete codes qemu-option.hx: Update missed parameter for colo-compare

 include/migration/colo.h  | 4 +---
 migration/colo-failover.c | 2 +-
 migration/colo.c          | 2 +-
 qemu-options.hx           | 9 ++++++---
 4 files changed, 9 insertions(+), 8 deletions(-)

--
2.17.GIT

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

#9 lore raw
In reply to Zhang Chen
Quoted 3 lines · * Zhang Chen ([email protected]) wrote:

From: Zhang Chen <[email protected]>

In this series we optimize codes and fix some tiny issues.

Queued

Quoted 6 lines

Zhang Chen (3):
migration/colo.c: Remove redundant input parameter migration/colo.h: Remove obsolete codes qemu-option.hx: Update missed parameter for colo-compare

Quoted 10 lines
 include/migration/colo.h  | 4 +---
 migration/colo-failover.c | 2 +-
 migration/colo.c          | 2 +-
 qemu-options.hx           | 9 ++++++---
 4 files changed, 9 insertions(+), 8 deletions(-)
Signature · 1 line
2.17.GIT

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