From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UvB2W-00085n-MU for qemu-devel@nongnu.org; Fri, 05 Jul 2013 14:47:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UvB2U-0002JC-OU for qemu-devel@nongnu.org; Fri, 05 Jul 2013 14:47:28 -0400 Received: from goliath.siemens.de ([192.35.17.28]:23031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UvAAM-00081s-6M for qemu-devel@nongnu.org; Fri, 05 Jul 2013 13:51:30 -0400 Message-ID: <51D7079A.2000907@siemens.com> Date: Fri, 05 Jul 2013 19:51:22 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1373027986-17868-1-git-send-email-stefanha@redhat.com> In-Reply-To: <1373027986-17868-1-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/3] qemu-timer: make QEMUTimer functions thread-safe List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Paolo Bonzini , Anthony Liguori , qemu-devel@nongnu.org, alex@alex.org.uk, rth@twiddle.net On 2013-07-05 14:39, Stefan Hajnoczi wrote: > This series makes the following functions thread-safe: > > qemu_mod_timer_ns() > qemu_mod_timer() > qemu_del_timer() > qemu_timer_pending() > > The following were already thread-safe: > > qemu_free_timer() > qemu_new_timer() > qemu_timer_expired() > > Now it is possible to use QEMUTimer outside the QEMU global mutex. Timer > callbacks are still invoked from the main loop. If a thread wishes to run > timer callbacks it must use a thread-safe QEMUBH (which Ping Fan Liu is working > on). What do you mean with this? We need main-loop independent timers for any task that depends on timely alarm delivery. Do your patches keep this in mind as well? > > Note that host_clock is not thread-safe because it keeps state and invokes > reset notifiers. Device emulation threads mostly care about vm_clock, so this > is not a problem. I suppose you know that vm_clock cannot be read outside BQL yet due to timers_state and, under TCG, icount. Any ideas regarding this already? I didn't have to solve that problem so far as I only need CLOCK_REALTIME outside BQL. Jan -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux