qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Li Zhijian <lizhijian@cn.fujitsu.com>
To: "Zhang, Chen" <chen.zhang@intel.com>,
	"jasowang@redhat.com" <jasowang@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [PATCH 1/3] colo-compare: return -1 if no packet is queued
Date: Wed, 23 Sep 2020 14:17:38 +0800	[thread overview]
Message-ID: <5019ad5f-439e-ff9e-f67e-41e2ea76b615@cn.fujitsu.com> (raw)
In-Reply-To: <e1841d5119ff4d82ad01586d08ea45ec@intel.com>



On 9/23/20 9:41 AM, Zhang, Chen wrote:
>
>> -----Original Message-----
>> From: Li Zhijian <lizhijian@cn.fujitsu.com>
>> Sent: Tuesday, September 22, 2020 5:55 PM
>> To: Zhang, Chen <chen.zhang@intel.com>; jasowang@redhat.com
>> Cc: qemu-devel@nongnu.org; Li Zhijian <lizhijian@cn.fujitsu.com>
>> Subject: [PATCH 1/3] colo-compare: return -1 if no packet is queued
>>
>> Return 0 will trigger a packet comparison
>>
> Yes, we need active trigger a checkpoint to flush all the queued packets here.
Previously, no new checkpoint will be triggered since no new packet is queued though colo_compare_connection() is called.
actually we should send a notify to colo frame immediately, no need to compare them any more in order to less latency.

diff --git a/net/colo-compare.c b/net/colo-compare.c
index 3a45d64175..23092e4496 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -285,10 +285,13 @@ static int packet_enqueue(CompareState *s, int mode, Connection **con)
      }

      if (!ret) {
+        /* queue is too long, do a checkpoint to release all queued packets */
+        colo_compare_inconsistency_notify(s);
          trace_colo_compare_drop_packet(colo_mode[mode],
              "queue size too big, drop packet");
          packet_destroy(pkt, NULL);
          pkt = NULL;
+        return -1;
      }

      *con = conn;


> Otherwise, we should drop all the packet after this time still next checkpoint.
> So, I think original logic is a better choice.
>
> Thanks
> Zhang Chen
>
>> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
>> ---
>>   net/colo-compare.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/net/colo-compare.c b/net/colo-compare.c index
>> 3a45d64175..039b515611 100644
>> --- a/net/colo-compare.c
>> +++ b/net/colo-compare.c
>> @@ -289,6 +289,7 @@ static int packet_enqueue(CompareState *s, int
>> mode, Connection **con)
>>               "queue size too big, drop packet");
>>           packet_destroy(pkt, NULL);
>>           pkt = NULL;
>> +        return -1;
>>       }
>>
>>       *con = conn;
>> --
>> 2.28.0
>>
>>
>
>





  reply	other threads:[~2020-09-23  6:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22  9:55 [PATCH 0/3] colo-compare: minor fixes Li Zhijian
2020-09-22  9:55 ` [PATCH 1/3] colo-compare: return -1 if no packet is queued Li Zhijian
2020-09-23  1:41   ` Zhang, Chen
2020-09-23  6:17     ` Li Zhijian [this message]
2020-09-23  6:51       ` Zhang, Chen
2020-09-22  9:55 ` [PATCH 2/3] colo-compare: fix missing compare_seq initialization Li Zhijian
2020-09-23  1:42   ` Zhang, Chen
2020-09-22  9:55 ` [PATCH 3/3] colo-compare: check mark in mutual exclusion Li Zhijian
2020-09-23  1:46   ` Zhang, Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5019ad5f-439e-ff9e-f67e-41e2ea76b615@cn.fujitsu.com \
    --to=lizhijian@cn.fujitsu.com \
    --cc=chen.zhang@intel.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).