Re: [PATCH net] ipv6: move DAD and addrconf_verify processing to workqueue
From: Hannes Frederic Sowa <hidden>
Date: 2014-03-26 00:00:54
On Tue, Mar 25, 2014 at 02:20:04PM -0700, Stephen Hemminger wrote:
On Tue, 25 Mar 2014 09:03:01 +0100 Hannes Frederic Sowa [off-list ref] wrote:quoted
-static void addrconf_verify(unsigned long foo) +static void addrconf_verify_rtnl(void) { unsigned long now, next, next_sec, next_sched; struct inet6_ifaddr *ifp; int i; + ASSERT_RTNL(); + rcu_read_lock_bh(); spin_lock(&addrconf_verify_lock);Since RTNL is now held in addrconf_verify(), is addrconf_verify_lock is not needed.
Yes, I overlooked that, thanks!
Since RTNL is held, rcu is not needed either.
It might be possible if we add other rtnl lock invocations to the dad process, but because rcu is much more lightweight, I would leave it as is: ipv6_del_addr removes elements from inet6_addr_lst without holding RTNL but only synchronizes on addrconf_hash_lock. In this constellation RCU is still needed.
Also, I would skip the wrapper (addrconf_verify_rtnl) and just put it all in addrconf_verify_work
I preferred to have the addrconf_verify invocations inline and not deferred if we e.g. do cleanups from user space to not have any races because of not yet deleted addresses. I would also prefer to leave this as is, ok? Will send v2, thanks!