Re: [PATCH] netfilter: use per-CPU recursive lock {XV}

Stephen Hemminger
2009-04-26T21:58:15Z

On Sun, 26 Apr 2009 14:56:46 -0400
Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote:

> * Eric Dumazet (dada1@cosmosbay.com) wrote:
> > From: Stephen Hemminger <shemminger@vyatta.com>
> >
> > > Epilogue due to master Jarek. Lockdep carest not about the locking
> > > doth bestowed. Therefore no keys are needed.
> > >
> > > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> >
> > So far, so good, should be ready for inclusion now, nobody complained :)
> >
> > I include the final patch, merge of your last two patches.
> >
> > David, could you please review it once again and apply it if it's OK ?
>
> > Thanks to all for your help and patience
> >
> > [PATCH] netfilter: use per-CPU recursive lock {XV}
>
> Hi Eric,
>
> Suitable name would probably be :
>

But Linus is trying to delude himself.

This usage is recursive even if he doesn't like the terminology.
The same CPU has to be able to reacquire the read lock without deadlocking.
If reader/writer locks were implemented in a pure writer gets priority
method, then this code would break! So yes read locks can be used recursively
now in Linux, but if the were implemented differently then this code
would break. For example, the -rt kernel turns all read/write locks into
mutexs, so the -rt kernel developers will have to address this.