From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6AIk-0002qS-Dn for qemu-devel@nongnu.org; Sun, 04 Aug 2013 22:13:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6AIg-0002zb-PP for qemu-devel@nongnu.org; Sun, 04 Aug 2013 22:13:38 -0400 Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]:43485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6AIg-0002yp-HI for qemu-devel@nongnu.org; Sun, 04 Aug 2013 22:13:34 -0400 Received: by mail-la0-f45.google.com with SMTP id fj20so1655344lab.32 for ; Sun, 04 Aug 2013 19:13:33 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20130802144354.GG815@stefanha-thinkpad.redhat.com> References: <51F65044.4040706@redhat.com> <51F78491.708@redhat.com> <391717867.8023244.1375347472193.JavaMail.root@redhat.com> <753B6C66578E71C12F9DFD2A@Ximines.local> <1277844563.8104892.1375359574399.JavaMail.root@redhat.com> <97E9EFDF2EC4B9CE77638619@Ximines.local> <20130802144354.GG815@stefanha-thinkpad.redhat.com> From: liu ping fan Date: Mon, 5 Aug 2013 10:13:12 +0800 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Qemu-devel] [RFC v2 3/5] timer: make qemu_clock_enable sync between disable and timer's cb List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Alex Bligh , Jan Kiszka , qemu-devel@nongnu.org, Anthony Liguori , Paolo Bonzini On Fri, Aug 2, 2013 at 10:43 PM, Stefan Hajnoczi wrote: > On Fri, Aug 02, 2013 at 11:33:40AM +0800, liu ping fan wrote: >> On Thu, Aug 1, 2013 at 9:28 PM, Alex Bligh wrote: >> > Paolo, >> > >> > >> > --On 1 August 2013 08:19:34 -0400 Paolo Bonzini wrote: >> > >> >>> > True, qemu_event basically works only when a single thread resets it. >> >>> > But there is no race condition here because qemu_run_timers cannot be >> >>> > executed concurrently by multiple threads (like aio_poll in your >> >>> > bottom half patches). >> >>> >> >>> ... or, if rebasing on top of my patches, qemu_run_timers *can* be >> >>> executed concurrently by mulitple threads, but in respect of any given >> >>> QEMUTimerList, it will only be executed by one thread. >> >> >> >> >> >> ... so the event would be placed in QEMUTimerList, not QEMUClock. >> > >> > >> > Correct >> > >> > >> >> qemu_clock_enable then will have to visit all timer lists. That's >> >> not hard to do, >> > >> > >> > Correct, v4 of my patch does this. >> > >> > >> >> but as locks proliferate we need to have a clear >> >> policy (e.g. BQL -> clock -> timerlist). >> > >> > >> > But doesn't do the locking bit yet (Pingfan is going to do that I hope) >> > >> Seem that Stefanha had been involved in this, and sent out his patches :) > > Hi Ping Fan, > I dropped the series where I added locks to qemu-timer.c from a few > weeks ago. > > With your series rebased onto Alex's series, I think my patches are no > longer needed? > No. The active_timers list which is still touched by qemu_mod_timer_ns() needs protection between vcpu/iothread/.. I think you want to pick up your patches? Regards, Pingfan