netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: dada1@cosmosbay.com
Cc: paulmck@linux.vnet.ibm.com, netdev@vger.kernel.org
Subject: Re: [PATCH] net: remove superfluous call to synchronize_net()
Date: Fri, 17 Apr 2009 04:56:31 -0700 (PDT)	[thread overview]
Message-ID: <20090417.045631.159492677.davem@davemloft.net> (raw)
In-Reply-To: <49E6C4C7.3050105@cosmosbay.com>

From: Eric Dumazet <dada1@cosmosbay.com>
Date: Thu, 16 Apr 2009 07:40:23 +0200

> [PATCH] net: remove superfluous call to synchronize_net()
> 
> inet_register_protosw() function is responsible for adding a new
> inet protocol into a global table (inetsw[]) that is used with RCU rules.
> 
> As soon as the store of the pointer is done, other cpus might see
> this new protocol in inetsw[], so we have to make sure new protocol
> is ready for use. All pending memory updates should thus be committed
> to memory before setting the pointer.
> This is correctly done using rcu_assign_pointer()
> 
> synchronize_net() is typically used at unregister time, after
> unsetting the pointer, to make sure no other cpu is still using
> the object we want to dismantle. Using it at register time
> is only adding an artificial delay that could hide a real bug,
> and this bug could popup if/when synchronize_rcu() can proceed
> faster than now.
> 
> 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)
> 
> Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>

I think this change is fine, so I'm adding it to net-next-2.6

If you guys want to continue discussing the merits of putting
comments in every spot where we lack a RCU sync call, that's
your call. :-)


  parent reply	other threads:[~2009-04-17 11:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2009-04-17 19:25       ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090417.045631.159492677.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=dada1@cosmosbay.com \
    --cc=netdev@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).