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

From: Eric Dumazet <[email-masked]>
Date: Wed, 15 Apr 2009 17:38:06 +0200

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 <[email-masked]>

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: