Re: [ovs-dev] [PATCH 02/12] ovs-atomic: Use memory_order_relaxed for ovs_refcount.

2014-07-04 Thread Jarno Rajahalme
I just sent v2’s of the first patches discussed so far. Jarno On Jul 4, 2014, at 6:15 AM, Jarno Rajahalme wrote: > Additional data point: I used > http://en.cppreference.com/w/cpp/atomic/memory_order as a reference, and it > reads: > > “Typical use for relaxed memory ordering is updating c

Re: [ovs-dev] [PATCH 02/12] ovs-atomic: Use memory_order_relaxed for ovs_refcount.

2014-07-04 Thread Jarno Rajahalme
Additional data point: I used http://en.cppreference.com/w/cpp/atomic/memory_order as a reference, and it reads: “Typical use for relaxed memory ordering is updating counters, such as the reference counters of std::shared_ptr, since this only requires atomicity, but not ordering or synchroniza

Re: [ovs-dev] [PATCH 02/12] ovs-atomic: Use memory_order_relaxed for ovs_refcount.

2014-07-03 Thread Jarno Rajahalme
It seems I was too invested in the combined refcount/RCU case here. I still think that with RCU postponed destruction relaxed is the proper memory model. So maybe we should add a relaxed variant of the unref function to be used with RCU objects and make the normal unref use release to guarantee

Re: [ovs-dev] [PATCH 02/12] ovs-atomic: Use memory_order_relaxed for ovs_refcount.

2014-07-03 Thread Ben Pfaff
On Mon, Jun 30, 2014 at 08:17:18AM -0700, Jarno Rajahalme wrote: > Updating the reference count only requires atomicity, but no memory > ordering with respect to any other loads or stores. Avoiding the > overhead of the default memory_order_seq_cst can make these more > efficient. > > Signed-off-

[ovs-dev] [PATCH 02/12] ovs-atomic: Use memory_order_relaxed for ovs_refcount.

2014-06-30 Thread Jarno Rajahalme
Updating the reference count only requires atomicity, but no memory ordering with respect to any other loads or stores. Avoiding the overhead of the default memory_order_seq_cst can make these more efficient. Signed-off-by: Jarno Rajahalme --- lib/ovs-atomic.h |8 +--- 1 file changed, 5