[ofa-general] Re: A question about tx lock in ipoib_flush_paths
Yossi Etigin
yosefe at voltaire.com
Fri Jul 10 09:27:00 PDT 2009
akepner at sgi.com wrote:
> On Fri, Jul 10, 2009 at 02:27:56PM +0300, Yossi Etigin wrote:
>> akepner at sgi.com wrote:
>>> .....
>>> If so, it would be addressed by the patch I sent here:
>>>
>>> http://lists.openfabrics.org/pipermail/general/2009-July/060501.html
>>>
>>> because the ipoib_neigh structure wouldn't be freed until after
>>> ipoib_start_xmit() had done rcu_read_unlock().
>>>
>> Yes, I guess it would address the ipoib_neigh structure problem.
>> But then neigh->ah might be freed while xmit is using it.
>>
>
> Maybe I'm missing something, but what you say doesn't look
> correct.
>
> path_free() now does:
>
> if (neigh->ah)
> ipoib_put_ah(neigh->ah);
>
> (with a comment explaining that it's OK to do that while holding
> priv->lock.)
>
> But with the patch above, ipoib_put_ah() is deferred to the rcu
> callback (just like the kfree() of the ipoib_neigh structure is).
>
I see, you are right. ipoib_put_ah is moved to neigh_free context.
Looks like your patch does the job.
More information about the general
mailing list