From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2NEb-0005y4-2u for qemu-devel@nongnu.org; Mon, 16 May 2016 14:27:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2NEX-0003Z6-RH for qemu-devel@nongnu.org; Mon, 16 May 2016 14:27:16 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:55268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2NEV-0003Tz-Hv for qemu-devel@nongnu.org; Mon, 16 May 2016 14:27:13 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 8C53521B52 for ; Mon, 16 May 2016 14:27:01 -0400 (EDT) Date: Mon, 16 May 2016 14:27:01 -0400 From: "Emilio G. Cota" Message-ID: <20160516182701.GA13292@flamenco> References: <1463196873-17737-1-git-send-email-cota@braap.org> <1463196873-17737-7-git-send-email-cota@braap.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v5 06/18] atomics: add atomic_read_acquire and atomic_set_release List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pranith Kumar Cc: MTTCG Devel , Peter Crosthwaite , QEMU Developers , Sergey Fedorov , Paolo Bonzini , Alex =?iso-8859-1?Q?Benn=E9e?= , Richard Henderson On Sun, May 15, 2016 at 06:22:36 -0400, Pranith Kumar wrote: > On Fri, May 13, 2016 at 11:34 PM, Emilio G. Cota wrote: > > When __atomic is not available, we use full memory barriers instead > > of smp/wmb, since acquire/release barriers apply to all memory > > operations and not just to loads/stores, respectively. > > If it is not too late can we rename this to > atomic_load_acquire()/atomic_store_release() like in the linux kernel? I'd keep read/set just for consistency with the rest of the file. BTW in the kernel, atomic_{read/set}_{acquire/release} are defined in include/linux/atomic.h: #ifndef atomic_read_acquire #define atomic_read_acquire(v) smp_load_acquire(&(v)->counter) #endif #ifndef atomic_set_release #define atomic_set_release(v, i) smp_store_release(&(v)->counter, (i)) #endif The smp_load/store variants are called much more frequently, though. Thanks, Emilio