Re: [B.A.T.M.A.N.] Reordered rcu refcounting

Marek Lindner
2011-02-03T17:02:51Z

Hi,

> I told Linus and Marek that the implementation of some datastructures using
> reference counting and RCUs must be redesigned. The problem is that
> call_rcu should only be used when the reference count is zero because
> multiple call_rcu cannot be initiated at the same time. The next problem
> is that we may try to access an element with the refcount 0 when we try to
> traverse a rcu protected list. This problem cannot be solved by kref -
> thus we have to use atomic_t again to not increase the reference count
> when it was already zero.

I reviewed the posted patches, filled in the missing parts and fixed some bugs
along the way. Feel free to comment.

@Linus: I believe it would be a good idea if your gateway patch was based on
this patchset.

Cheers,
Marek