Subject: Re: [Patch net-next v3 3/3] igmp: convert RTNL lock to a spinlock

From: Cong Wang <[email-masked]>
Date: Thu, 06 Jun 2013 10:50:18 +0800

On Wed, 2013-06-05 at 19:40 -0700, Eric Dumazet wrote:
> On Thu, 2013-06-06 at 10:20 +0800, Cong Wang wrote:
> > From: Cong Wang <[email-masked]>
> > 
> > It is not necessary to hold RTNL lock to protect mc_list,
> > at least IPv6 mcast is using a local spinlock, IPv4 can do
> > this too. This patch converts RTNL lock+RCU to spinlock+RCU.
> > 
> 
> Why are you doing this ? 

RTNL is becoming another big kernel lock, we should not hold it unless
we have to, right?

> 
> Really, holding a spinlock in this code instead of a mutex brings all
> kind of problems.
> 
> For example, you have to use GFP_ATOMIC allocations instead of
> GFP_KERNEL
> 
> Not counting the race/bug you added in ip_mc_join_group()
> 

Maybe I should replace the spinlock with a mutex?