[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1371285877.23997.14.camel@cr0>
Date: Sat, 15 Jun 2013 16:44:37 +0800
From: Cong Wang <amwang@...hat.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: netdev@...r.kernel.org,
Stephen Hemminger <stephen@...workplumber.org>,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [Patch net-next v5 3/3] igmp: convert RTNL lock to a spinlock
On Sat, 2013-06-15 at 01:26 -0700, Eric Dumazet wrote:
> On Sat, 2013-06-15 at 16:12 +0800, Cong Wang wrote:
>
> > I _did_ try to replace spinlock with mutex, but apparently mutex_lock()
> > can't be called with rcu_read_lock() held, which is the case in
> > ip_mc_drop_socket().
> >
>
> If you hold a mutex, there is no need for rcu_read_lock() at all.
>
> Nobody can change the lists while you are the owner.
>
> We already have nice helpers, lockdep enabled.
>
> check rtnl_dereference() uses
>
>
Oops, I should mean to say ip_mc_leave_group(), not
ip_mc_drop_socket()...
The reason why it holds RCU is to get in_dev and still uses it after
spinlock is held, but I think we can fix ip_mc_find_dev() so that we can
call it without holding RCU outside, by taking a ref to in_dev?
Thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists