From: "Zhang, Chen" <chen.zhang@intel.com>
To: Li Zhijian <lizhijian@cn.fujitsu.com>,
Jason Wang <jasowang@redhat.com>,
qemu-dev <qemu-devel@nongnu.org>
Cc: Zhang Chen <zhangckid@gmail.com>
Subject: RE: [PATCH 3/4] net/colo-compare.c: Add secondary old packet detection
Date: Wed, 23 Sep 2020 06:47:27 +0000 [thread overview]
Message-ID: <a46e87a6aa2b4237abb47f276b6ed97c@intel.com> (raw)
In-Reply-To: <a7b2e242-e19f-107c-7b72-0eea6eb300dc@cn.fujitsu.com>
> -----Original Message-----
> From: Li Zhijian <lizhijian@cn.fujitsu.com>
> Sent: Tuesday, September 22, 2020 2:47 PM
> To: Zhang, Chen <chen.zhang@intel.com>; Jason Wang
> <jasowang@redhat.com>; qemu-dev <qemu-devel@nongnu.org>
> Cc: Zhang Chen <zhangckid@gmail.com>
> Subject: Re: [PATCH 3/4] net/colo-compare.c: Add secondary old packet
> detection
>
>
>
> On 9/18/20 5:22 PM, Zhang Chen wrote:
> > From: Zhang Chen <chen.zhang@intel.com>
> >
> > Detect queued secondary packet to sync VM state in time.
> >
> > Signed-off-by: Zhang Chen <chen.zhang@intel.com>
> > ---
> > net/colo-compare.c | 25 ++++++++++++++++---------
> > 1 file changed, 16 insertions(+), 9 deletions(-)
> >
> > diff --git a/net/colo-compare.c b/net/colo-compare.c index
> > 3b72309d08..f7271b976f 100644
> > --- a/net/colo-compare.c
> > +++ b/net/colo-compare.c
> > @@ -641,19 +641,26 @@ void colo_compare_unregister_notifier(Notifier
> *notify)
> > static int colo_old_packet_check_one_conn(Connection *conn,
> > CompareState *s)
> > {
> > - GList *result = NULL;
> > -
> > - result = g_queue_find_custom(&conn->primary_list,
> > - &s->compare_timeout,
> > - (GCompareFunc)colo_old_packet_check_one);
> > + if (!g_queue_is_empty(&conn->primary_list)) {
> Looks we don't need to check is_empty
Re-checked glib code, it just checked the queue rather than inside content.
Maybe check empty before that will benefit performance.
Thanks
Zhang Chen
>
> > + if (g_queue_find_custom(&conn->primary_list,
> > + &s->compare_timeout,
> > + (GCompareFunc)colo_old_packet_check_one))
> > + goto out;
> > + }
> >
> > - if (result) {
> > - /* Do checkpoint will flush old packet */
> > - colo_compare_inconsistency_notify(s);
> > - return 0;
> > + if (!g_queue_is_empty(&conn->secondary_list)) {
> Ditto
>
> Thanks
> > + if (g_queue_find_custom(&conn->secondary_list,
> > + &s->compare_timeout,
> > + (GCompareFunc)colo_old_packet_check_one))
> > + goto out;
> > }
> >
> > return 1;
> > +
> > +out:
> > + /* Do checkpoint will flush old packet */
> > + colo_compare_inconsistency_notify(s);
> > + return 0;
> > }
> >
> > /*
>
>
next prev parent reply other threads:[~2020-09-23 6:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-18 9:21 [PATCH 0/4] Several optimization and bugfix for COLO compare Zhang Chen
2020-09-18 9:22 ` [PATCH 1/4] net/colo-compare.c: Fix compare_timeout format issue Zhang Chen
2020-09-22 6:14 ` Li Zhijian
2020-09-18 9:22 ` [PATCH 2/4] net/colo-compare.c: Change the timer clock type Zhang Chen
2020-09-22 6:18 ` Li Zhijian
2020-09-18 9:22 ` [PATCH 3/4] net/colo-compare.c: Add secondary old packet detection Zhang Chen
2020-09-22 6:46 ` Li Zhijian
2020-09-23 6:47 ` Zhang, Chen [this message]
2020-09-24 2:35 ` Li Zhijian
2020-09-18 9:22 ` [PATCH 4/4] net/colo-compare.c: Increase default queued packet scan frequency 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=a46e87a6aa2b4237abb47f276b6ed97c@intel.com \
--to=chen.zhang@intel.com \
--cc=jasowang@redhat.com \
--cc=lizhijian@cn.fujitsu.com \
--cc=qemu-devel@nongnu.org \
--cc=zhangckid@gmail.com \
/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).