Subject: Re: [PATCH] inetpeer: optimizations

From: Jarek Poplawski <[email-masked]>
Date: Sun, 6 Dec 2009 21:18:24 +0100

On Sun, Dec 06, 2009 at 07:58:07PM +0100, Eric Dumazet wrote:
> Yes, you miss something. We are not working on a true reference count variable.
> (p is referenced in avl tree but there is no +1 count for this reference)
> 
> Its more a usecount one, and p usecount can be 0 but p still in avl tree.
> 
> Even if we are the thread (A) doing 1 -> 0 transition, other thread (B)
> can find p and perform the opposite 0 -> 1 transition.
> 
> If (B) tries to unlink p before (A), it finds p already unlinked.
> 
> Then (A) links into unused list, while refcnt is still 1

This last thing can happen now too, but as I wrote, my idea was wrong,
nevertheless.

Jarek P.