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

From: Stephen Hemminger <[email-masked]>
Date: Sun, 26 Apr 2009 14:57:46 -0700

On Sun, 26 Apr 2009 14:56:46 -0400
Mathieu Desnoyers <[email-masked]> wrote:

> * Eric Dumazet ([email-masked]) wrote:
> > From: Stephen Hemminger <[email-masked]>
> > 
> > > Epilogue due to master Jarek. Lockdep carest not about the locking
> > > doth bestowed. Therefore no keys are needed.
> > > 
> > > Signed-off-by: Stephen Hemminger <[email-masked]>
> > 
> > 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.