qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V12 06/10] colo-compare: introduce packet compar


From: Jason Wang
Subject: Re: [Qemu-devel] [PATCH V12 06/10] colo-compare: introduce packet comparison thread
Date: Thu, 1 Sep 2016 15:38:22 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0



On 2016年09月01日 12:50, Zhang Chen wrote:
  + sprintf(thread_name, "colo-compare %d", compare_id);
+    qemu_thread_create(&s->thread, thread_name,
+                       colo_compare_thread, s,
+                       QEMU_THREAD_JOINABLE);
+    compare_id++;
+
+ /* A regular timer to kick any packets that the secondary doesn't match */ + s->timer = timer_new_ms(QEMU_CLOCK_VIRTUAL, /* Only when guest runs */
+                            check_old_packet_regular, s);
+    timer_mod(s->timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) +
+                        REGULAR_PACKET_CHECK_MS);

I still think we need to make sure the timer were processed in colo thread. Since check_old_packet_regular may iterate conn_list which may be modified by colo thread at the same time.

Make sense, but in here we just read the conn_list, maybe we should add a lock for it? Because of we don't have a easy way to make timer's handler run in colo thread,
the handler run in main-loop. Maybe this job we can do it later.

Thanks
Zhang Chen

A lock is ok for this series. But need to add a TODO here and we something like patch 1 to make sure timer could be processed other than main loop in the future.

Thanks




reply via email to

[Prev in Thread] Current Thread [Next in Thread]