Received: from eggs.gnu.org ([2001:4830:134:3::10]:40882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3kJo-0007JD-KP for qemu-devel@nongnu.org; Tue, 01 Dec 2015 07:46:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3kJl-0006tq-7B for qemu-devel@nongnu.org; Tue, 01 Dec 2015 07:46:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3kJl-0006tl-1g for qemu-devel@nongnu.org; Tue, 01 Dec 2015 07:46:01 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id A5F7796F6 for ; Tue, 1 Dec 2015 12:46:00 +0000 (UTC) Date: Tue, 1 Dec 2015 20:45:47 +0800 From: Peter Xu Message-ID: <20151201124545.GB31109@pxdev.xzpeter.org> References: <1448883140-20249-1-git-send-email-peterx@redhat.com> <1448883140-20249-11-git-send-email-peterx@redhat.com> <565C478A.8080106@redhat.com> <20151201035755.GI21032@pxdev.xzpeter.org> <565D6E68.1060303@redhat.com> <20151201123250.GA31109@pxdev.xzpeter.org> <565D9491.5000909@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <565D9491.5000909@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 10/12] Dump: add qmp command "query-dump" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: drjones@redhat.com, lersek@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, famz@redhat.com, lcapitulino@redhat.com On Tue, Dec 01, 2015 at 01:37:37PM +0100, Paolo Bonzini wrote: > atomic_mb_{read,set} does order accesses to the variable against > all other accesses. In this case I'd prefer it to smp_wmb/rmb, because > the writes to written_size are far from the writes to status. Yes... It should be again all the other variables. > > Compare with thread-pool.c: > > req->ret = ret; > /* Write ret before state. */ > smp_wmb(); > req->state = THREAD_DONE; > > /* Read state before ret. */ > smp_rmb(); > > /* Schedule ourselves in case elem->common.cb() calls aio_poll() to > * wait for another request that completed at the same time. > */ > qemu_bh_schedule(pool->completion_bh); > > elem->common.cb(elem->common.opaque, elem->ret); > > It's a matter of taste though. What you wrote above is certainly okay > as well. Thanks for the explanation. Then I will choose smp_*() this time and post v4 later. Peter > > Paolo