Re: [PATCH] netfilter: use per-CPU r**ursive lock {XV}

Paul E. McKenney
2009-04-28T15:42:31Z

On Tue, Apr 28, 2009 at 06:43:40AM -0700, David Miller wrote:
> From: Ingo Molnar <mingo@elte.hu>
> Date: Tue, 28 Apr 2009 14:40:33 +0200
>
> > IMHO this locking construct should be considered for
> > linux/local_lock.h and kernel/local_lock.c. Even if the netfilter
> > code drops its use soon afterwards ;-)
>
> If you can show me have to pass a per-cpu variable (the variable,
> not a dereference of it) as an argument to an inline function,
> I'll implement this :-)
>
> It has to be dereferenced after local_bh_disable() for the
> read side acquisition.

The way I did this in treercu.c was to create an array of references
to the per-CPU data in question. Not necessarily recommended, but
one way of doing it. That said, one could argue that we should wait
until we have at least three users before creating a generic primitive.

And I just know that I am going to regret this deeply, but I cannot
resist posting the following URL:

http://en.wikipedia.org/wiki/Wikipedia:Avoid_Parkinson's_Bicycle_Shed_Effect

Thanx, Paul