From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw3nZ-0003LR-Ms for qemu-devel@nongnu.org; Fri, 29 Apr 2016 04:29:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aw3nS-0001Ye-DK for qemu-devel@nongnu.org; Fri, 29 Apr 2016 04:29:16 -0400 Received: from [59.151.112.132] (port=6156 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw3nR-0001Qy-EG for qemu-devel@nongnu.org; Fri, 29 Apr 2016 04:29:10 -0400 References: <1460977906-25218-1-git-send-email-zhangchen.fnst@cn.fujitsu.com> <1460977906-25218-4-git-send-email-zhangchen.fnst@cn.fujitsu.com> <5721C2AE.6080305@redhat.com> <5721E66F.5070805@cn.fujitsu.com> <5722C1F5.60407@redhat.com> From: Zhang Chen Message-ID: <57231B40.2040605@cn.fujitsu.com> Date: Fri, 29 Apr 2016 16:28:48 +0800 MIME-Version: 1.0 In-Reply-To: <5722C1F5.60407@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH V3 3/4] colo-compare: introduce packet comparison thread List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang , qemu devel Cc: Li Zhijian , Gui jianfeng , Wen Congyang , zhanghailiang , Yang Hongyang , "eddie.dong" , "Dr. David Alan Gilbert" On 04/29/2016 10:07 AM, Jason Wang wrote: > > On 04/28/2016 06:31 PM, Zhang Chen wrote: >>>> +/* >>>> + * called from the compare thread on the primary >>>> + * for compare connection >>>> + */ >>>> +static void colo_compare_connection(void *opaque, void *user_data) >>>> +{ >>>> + Connection *conn = opaque; >>>> + Packet *pkt = NULL; >>>> + GList *result = NULL; >>>> + int ret; >>>> + >>>> + qemu_mutex_lock(&conn->list_lock); >>>> + while (!g_queue_is_empty(&conn->primary_list) && >>>> + !g_queue_is_empty(&conn->secondary_list)) { >>>> + pkt = g_queue_pop_head(&conn->primary_list); >>>> + result = g_queue_find_custom(&conn->secondary_list, >>>> + pkt, >>>> (GCompareFunc)colo_packet_compare_all); >>>> + >>>> + if (result) { >>>> + ret = compare_chr_send(pkt->s->chr_out, pkt->data, >>>> pkt->size); >>>> + if (ret < 0) { >>>> + error_report("colo_send_primary_packet failed"); >>>> + } >>>> + trace_colo_compare_main("packet same and release packet"); >>>> + g_queue_remove(&conn->secondary_list, result->data); >>>> + } else { >>>> + trace_colo_compare_main("packet different"); >>>> + g_queue_push_head(&conn->primary_list, pkt); >>> Is this possible that the packet from secondary has not been arrived on >>> time? If yes, do we still need to notify the checkpoint here? >> Yes,the packet of secondary may not arrived. >> we will hold primary packet to next periodic checkpoint >> to flush it. and more, I consider to set a timer >> to flush timeout(200ms???) packet like Dave's branch. >> >> >> Thanks >> zhangchen > I was wondering maybe you can merge or unify all other changes from > Dave's branch? > Yes, I will unify some codes from Dave's colo-proxy branch. Thanks Zhang Chen > . > -- Thanks zhangchen