netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: David Miller <davem@davemloft.net>
Cc: dada1@cosmosbay.com, netdev@vger.kernel.org
Subject: Re: [PATCH] net: remove superfluous call to synchronize_net()
Date: Fri, 17 Apr 2009 12:25:51 -0700	[thread overview]
Message-ID: <20090417192551.GA15538@linux.vnet.ibm.com> (raw)
In-Reply-To: <20090417.045631.159492677.davem@davemloft.net>

On Fri, Apr 17, 2009 at 04:56:31AM -0700, David Miller wrote:
> 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. :-)

Your Honor, I plead guilty to charges as read.  ;-)

							Thanx, Paul

      reply	other threads:[~2009-04-17 19:25 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
2009-04-17 19:25       ` Paul E. McKenney [this message]

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=20090417192551.GA15538@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=dada1@cosmosbay.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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).