[PATCH] net: remove superfluous call to synchronize_net()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David S. Miller <davem@...>
Cc: Linux Netdev List <netdev@...>, Paul E. McKenney <paulmck@...>
Date: Wednesday, April 15, 2009 - 11:38 am

inet_register_protosw() is adding inet_protosw to inetsw[] with appropriate
locking section and rcu variant. No need to call synchronize_net() to wait
for a RCU grace period. Changes are immediatly visible to other cpus anyway.

This saves about 13 ms on boot time on a HZ=1000 8 cpus machine ;)
(4 calls to inet_register_protosw(), and about 3200 us per call)

But more seriously, we should audit all synchronize_{rcu|net}() calls
to make sure we dont waste time and hide some bugs because of artificial
delays.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>

diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 7f03373..1706896 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1003,8 +1003,6 @@ void inet_register_protosw(struct inet_protosw *p)
 out:
 	spin_unlock_bh(&inetsw_lock);
 
-	synchronize_net();
-
 	return;
 
 out_permanent:
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] net: remove superfluous call to synchronize_net(), Eric Dumazet, (Wed Apr 15, 11:38 am)
Re: [PATCH] net: remove superfluous call to synchronize_net(), Paul E. McKenney, (Wed Apr 15, 5:54 pm)
Re: [PATCH] net: remove superfluous call to synchronize_net(), Paul E. McKenney, (Fri Apr 17, 3:25 pm)
Re: [PATCH] net: remove superfluous call to synchronize_net(), Paul E. McKenney, (Thu Apr 16, 11:52 am)
Re: [PATCH] net: remove superfluous call to synchronize_net(), Paul E. McKenney, (Thu Apr 16, 2:02 pm)