Re: [PATCH net-next v3] net: remove delay at device dismantle
From: David Miller <davem@davemloft.net>
Date: 2012-08-23 04:50:57
From: Gao feng <redacted> Date: Thu, 23 Aug 2012 12:33:03 +0800
于 2012年08月23日 11:19, Eric Dumazet 写道:quoted
From: Eric Dumazet <edumazet@google.com> I noticed extra one second delay in device dismantle, tracked down to a call to dst_dev_event() while some call_rcu() are still in RCU queues. These call_rcu() were posted by rt_free(struct rtable *rt) calls. We then wait a little (but one second) in netdev_wait_allrefs() before kicking again NETDEV_UNREGISTER. As the call_rcu() are now completed, dst_dev_event() can do the needed device swap on busy dst. To solve this problem, add a new NETDEV_UNREGISTER_FINAL, called after a rcu_barrier(), but outside of RTNL lock. Use NETDEV_UNREGISTER_FINAL with care ! Change dst_dev_event() handler to react to NETDEV_UNREGISTER_FINAL Also remove NETDEV_UNREGISTER_BATCH, as its not used anymore after IP cache removal. With help from Gao feng Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Tom Herbert <redacted> Cc: Mahesh Bandewar <redacted> Cc: "Eric W. Biederman" <redacted> Cc: Gao feng <redacted>looks good to me, the lockdep warning message disappeared.
Applied, thanks everyone.