Re: [Qemu-devel] [PATCH] atomic: using memory_order_relaxed for refcnt inc/dec ops

2013-07-13 Thread liu ping fan
On Sat, Jul 13, 2013 at 12:24 AM, Richard Henderson wrote: > On 07/11/2013 11:32 PM, Liu Ping Fan wrote: >> Refcnt's atomic inc/dec ops are frequent and its idiom need no seq_cst >> order. So to get better performance, it worth to adopt _relaxed >> other than _seq_cst memory model on them. > > You

Re: [Qemu-devel] [PATCH] atomic: using memory_order_relaxed for refcnt inc/dec ops

2013-07-12 Thread Richard Henderson
On 07/11/2013 11:32 PM, Liu Ping Fan wrote: > Refcnt's atomic inc/dec ops are frequent and its idiom need no seq_cst > order. So to get better performance, it worth to adopt _relaxed > other than _seq_cst memory model on them. You'd need to update the documentation then. As it stands, what you've

[Qemu-devel] [PATCH] atomic: using memory_order_relaxed for refcnt inc/dec ops

2013-07-11 Thread Liu Ping Fan
Refcnt's atomic inc/dec ops are frequent and its idiom need no seq_cst order. So to get better performance, it worth to adopt _relaxed other than _seq_cst memory model on them. We resort to gcc builtins. If gcc supports C11 memory model, __atomic_* buitlins is used, otherwise __sync_* builtins. S