[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)
#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
- Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock, (continued)
[Qemu-devel] [PATCH v5 18/18] translate-all: add tb hash bucket info to 'info jit' dump, Emilio G. Cota, 2016/05/13
[Qemu-devel] [PATCH v5 04/18] include/processor.h: define cpu_relax(), Emilio G. Cota, 2016/05/13
[Qemu-devel] [PATCH v5 06/18] atomics: add atomic_read_acquire and atomic_set_release, Emilio G. Cota, 2016/05/13
[Qemu-devel] [PATCH v5 13/18] qht: support parallel writes, Emilio G. Cota, 2016/05/13
[Qemu-devel] [PATCH v5 10/18] qdist: add module to represent frequency distributions of data, Emilio G. Cota, 2016/05/13
[Qemu-devel] [PATCH v5 08/18] exec: add tb_hash_func5, derived from xxhash, Emilio G. Cota, 2016/05/13