netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: remove superfluous call to synchronize_net()
@ 2009-04-15 15:38 Eric Dumazet
  2009-04-15 21:54 ` Paul E. McKenney
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Dumazet @ 2009-04-15 15:38 UTC (permalink / raw)
  To: David S. Miller; +Cc: Linux Netdev List, Paul E. McKenney

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:

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-04-17 19:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-15 15:38 [PATCH] net: remove superfluous call to synchronize_net() Eric Dumazet
2009-04-15 21:54 ` Paul E. McKenney
2009-04-16  5:40   ` Eric Dumazet
2009-04-16 15:52     ` Paul E. McKenney
2009-04-16 16:03       ` Eric Dumazet
2009-04-16 18:02         ` Paul E. McKenney
2009-04-16 18:43           ` Eric Dumazet
2009-04-17 11:56     ` David Miller
2009-04-17 19:25       ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).