From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UosFv-0005ls-5m for qemu-devel@nongnu.org; Tue, 18 Jun 2013 05:31:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UosFr-0001Cu-5A for qemu-devel@nongnu.org; Tue, 18 Jun 2013 05:31:15 -0400 Received: from mail-we0-x22a.google.com ([2a00:1450:400c:c03::22a]:46083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UosFr-0001Cp-02 for qemu-devel@nongnu.org; Tue, 18 Jun 2013 05:31:11 -0400 Received: by mail-we0-f170.google.com with SMTP id w57so3222312wes.1 for ; Tue, 18 Jun 2013 02:31:10 -0700 (PDT) Date: Tue, 18 Jun 2013 11:31:07 +0200 From: Stefan Hajnoczi Message-ID: <20130618093107.GB7649@stefanha-thinkpad.redhat.com> References: <1371381681-14252-1-git-send-email-pingfanl@linux.vnet.ibm.com> <1371381681-14252-3-git-send-email-pingfanl@linux.vnet.ibm.com> <20130617152814.GB31444@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v2 2/2] QEMUBH: make AioContext's bh re-entrant List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: liu ping fan Cc: Paolo Bonzini , qemu-devel@nongnu.org, Anthony Liguori On Tue, Jun 18, 2013 at 10:19:40AM +0800, liu ping fan wrote: > On Mon, Jun 17, 2013 at 11:28 PM, Stefan Hajnoczi wrote: > > On Sun, Jun 16, 2013 at 07:21:21PM +0800, Liu Ping Fan wrote: > > Why lock bh_lock before assigning bh->next? Could you lock the mutex > > here and then drop the smp_wmb() since the pthread function already does > > that? > > > As Paolo's explain, it will open race gap for writers. Right, thanks!