[ovs-dev] [PATCH 2/7] datapath: Add ref counting for flows.

Ben Pfaff blp at nicira.com
Mon Sep 20 19:09:57 UTC 2010


On Mon, Sep 20, 2010 at 11:13:40AM -0700, Jesse Gross wrote:
> Currently flows are only used within the confines of one
> rcu_read_lock()/rcu_read_unlock() session.  However, with the
> addition of header caching we will need to hold references to flows
> for longer periods of time.  This adds support for that by adding
> refcounts to flows.  RCU is still used for normal packet handling
> to avoid a performance impact from constantly updating the refcount.
> However, instead of directly freeing the flow after a grace period
> we simply decrement the refcount.

The new member "dead" is write-only in this patch.  I guess that you
will use it later?

I guess you don't like "kref"?  You could use it, if you did.  When I
look at kref_init() and kref_get(), I see some memory barriers that the
open-coded versions here don't have.  Do we need them too?




More information about the dev mailing list