[ovs-dev] [PATCH 07/10] datapath: Add casts for direct freeing of RCU data.

Jesse Gross jesse at nicira.com
Wed Dec 29 18:33:56 UTC 2010


On Wed, Dec 29, 2010 at 1:05 PM, Ben Pfaff <blp at nicira.com> wrote:
> On Tue, Dec 28, 2010 at 08:50:45PM -0800, Jesse Gross wrote:
>> There are a few places where we have two levels of RCU protected
>> data to allow the second level to change independently of the
>> first.  Although the two pieces are independent, they have the
>> same users and the same lifetime.  This means that we directly
>> free the second level when it is safe to free the first.  This
>> implies that we directly access RCU-protected data, which is
>> generally not allowed.  There are locks to check, so none of the
>> normal RCU functions apply.  Instead, this adds an explicit cast.
>>
>> Found with sparse.
>>
>> Signed-off-by: Jesse Gross <jesse at nicira.com>
>
> Well, they don't have exactly the same lifetime or there would be no
> point in RCU-protecting the inner part.  Rather, if the outer part
> dies then the inner part dies too.

Right.  I updated the commit message to clarify that.




More information about the dev mailing list