[ovs-dev] [PATCH v2 4/5] Use ovs_refcount_unref_relaxed.

Jarno Rajahalme jrajahalme at nicira.com
Mon Jul 7 20:48:01 UTC 2014


On Jul 7, 2014, at 9:47 AM, Ben Pfaff <blp at nicira.com> wrote:

> On Fri, Jul 04, 2014 at 07:21:18AM -0700, Jarno Rajahalme wrote:
>> After a quick analysis, in most cases the access to refcounted objects
>> is clearly protected either with an explicit lock/mutex, or RCU. there
>> are only a few places where I left a call to ovs_refcount_unref().
>> Upon closer analysis it may well be that those could also use the
>> relaxed form.
>> 
>> Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
> 
> I didn't look at these closely.  Should I?

Actually, it would be kind of nice if we could eliminate the “normal” form of ovs_refcount_unref() and rename the ovs_refcount_unref_relaxed() as ovs_refcount_unref(), and also document that the access to the object being refcounted needs to be protected by a lock or a mutex, or it’s destruction needs to be RCU-postponed. Having too variants with different rules may be a bit complicated.

To this end, it would be good if another pair of eyes checked/confirmed that a) the _relaxed() users actually conform to the above, and b) if/how the remaining users of ovs_refcount_unref() could be changed to conform to the new semantics.

Nonetheless, I just pushed this together with the rest of the new series you just reviewed.

  Jarno

> 
> Acked-by: Ben Pfaff <blp at nicira.com>




More information about the dev mailing list