[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 06/18] atomics: add atomic_read_acquire and a

From: Emilio G. Cota
Subject: Re: [Qemu-devel] [PATCH v5 06/18] atomics: add atomic_read_acquire and atomic_set_release
Date: Mon, 16 May 2016 14:27:01 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

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 <address@hidden> 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)

    #ifndef atomic_set_release
    #define  atomic_set_release(v, i)       smp_store_release(&(v)->counter, 

The smp_load/store variants are called much more frequently, though.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]