From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMIAP-0002Za-LT for qemu-devel@nongnu.org; Wed, 18 Sep 2013 09:51:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMIAG-0004eD-He for qemu-devel@nongnu.org; Wed, 18 Sep 2013 09:51:41 -0400 Received: from mail-ea0-x231.google.com ([2a00:1450:4013:c01::231]:65115) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMIAG-0004do-Ai for qemu-devel@nongnu.org; Wed, 18 Sep 2013 09:51:32 -0400 Received: by mail-ea0-f177.google.com with SMTP id f15so3441022eak.22 for ; Wed, 18 Sep 2013 06:51:31 -0700 (PDT) Date: Wed, 18 Sep 2013 15:51:29 +0200 From: Stefan Hajnoczi Message-ID: <20130918135129.GC25444@stefanha-thinkpad.redhat.com> References: <1378976540-10812-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1378976540-10812-1-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 0/3] qemu-timer: make qemu_timer_mod_ns() and qemu_timer_del() thread-safe List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Anthony Liguori , Paolo Bonzini , Ping Fan Liu , qemu-devel@nongnu.org, alex@alex.org.uk On Thu, Sep 12, 2013 at 11:02:17AM +0200, Stefan Hajnoczi wrote: > v4: > * Rebased & retested for easy review and merge > * No code changes > > v3: > * Squashed Paolo's fixes and added his patch to avoid locking in timer_pending() > > v2: > * Rebased onto qemu.git/master following the merge of Alex's AioContext timers > > The purpose of these patches is to eventually allow device models to set and > cancel timers without holding the global mutex. When the device model runs in > a vcpu thread and the iothread processes timers, the > QEMUTimerList->active_timers must be protected from concurrent access. > > Patch 1 is a clean-up. > > Patch 2 is the entire change needed to protect ->active_timers. > > Patch 3 makes timer_pending() run without a lock. > > Paolo Bonzini (1): > qemu-timer: do not take the lock in timer_pending > > Stefan Hajnoczi (2): > qemu-timer: drop outdated signal safety comments > qemu-timer: make qemu_timer_mod_ns() and qemu_timer_del() thread-safe > > include/qemu/timer.h | 17 ++++++++++ > qemu-timer.c | 92 ++++++++++++++++++++++++++++++++++++---------------- > 2 files changed, 81 insertions(+), 28 deletions(-) Applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan