mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: paulmck@linux.vnet.ibm.com
Cc: Dave Chiluk <chiluk@canonical.com>,
	Rafael Tinoco <rafael.tinoco@canonical.com>,
	linux-kernel@vger.kernel.org, davem@davemloft.net,
	Christopher Arges <chris.j.arges@canonical.com>,
	Jay Vosburgh <jay.vosburgh@canonical.com>
Subject: Re: Possible netns creation and execution performance/scalability regression since v3.8 due to rcu callbacks being offloaded to multiple cpus
Date: Wed, 11 Jun 2014 13:55:45 -0700	[thread overview]
Message-ID: <87r42v2mjy.fsf@x220.int.ebiederm.org> (raw)
In-Reply-To: <20140611194832.GL4581@linux.vnet.ibm.com> (Paul E. McKenney's message of "Wed, 11 Jun 2014 12:48:32 -0700")

"Paul E. McKenney" <paulmck@linux.vnet.ibm.com> writes:

> On Wed, Jun 11, 2014 at 01:27:07PM -0500, Dave Chiluk wrote:
>> On 06/11/2014 11:18 AM, Paul E. McKenney wrote:
>> > On Wed, Jun 11, 2014 at 10:46:00AM -0500, David Chiluk wrote:
>> >> Now think about what happens when a gateway goes down, the namespaces
>> >> need to be migrated, or a new machine needs to be brought up to replace
>> >> it.  When we're talking about 3000 namespaces, the amount of time it
>> >> takes simply to recreate the namespaces becomes very significant.
>> >>
>> >> The script is a stripped down example of what exactly is being done on
>> >> the neutron gateway in order to create namespaces.
>> > 
>> > Are the namespaces torn down and recreated one at a time, or is there some
>> > syscall, ioctl(), or whatever that allows bulk tear down and recreating?
>> > 
>> > 							Thanx, Paul
>> 
>> In the normal running case, the namespaces are created one at a time, as
>> new customers create a new set of VMs on the cloud.
>> 
>> However, in the case of failover to a new neutron gateway the namespaces
>> are created all at once using the ip command (more or less serially).
>> 
>> As far as I know there is no syscall or ioctl that allows bulk tear down
>> and recreation.  if such a beast exists that might be helpful.
>
> The solution might be to create such a beast.  I might be able to shave
> a bit of time off of this benchmark, but at the cost of significant
> increases in RCU's CPU consumption.  A bulk teardown/recreation API could
> reduce the RCU grace-period overhead by several orders of magnitude by
> having a single RCU grace period cover a few thousand changes.
>
> This is why other bulk-change syscalls exist.
>
> Just out of curiosity, what syscalls does the ip command use?

You can look in iproute2 ip/ipnetns.c

But rought ip netns add does:

unshare(CLONE_NEWNET);
mkdir /var/run/netns/<name>
mount --bind /proc/self/ns/net /var/run/netns/<name>

I don't know if there is any sensible way to batch that work.

(The unshare gets you into copy_net_ns in net/core/net_namespace.c
 and to find all of the code it can call you have to trace all
 of the register_pernet_subsys and register_pernet_device calls).

At least for creation I would like to see if we can make all of the
rcu_callback synchronize_rcu calls go away.  That seems preferable
to batching at creation time.

Eric

  reply	other threads:[~2014-06-11 20:56 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11  5:52 Rafael Tinoco
2014-06-11  7:07 ` Eric W. Biederman
2014-06-11 13:39 ` Paul E. McKenney
2014-06-11 15:17   ` Rafael Tinoco
2014-06-11 15:46     ` David Chiluk
2014-06-11 16:18       ` Paul E. McKenney
2014-06-11 18:27         ` Dave Chiluk
2014-06-11 19:48           ` Paul E. McKenney
2014-06-11 20:55             ` Eric W. Biederman [this message]
2014-06-11 21:03               ` Rafael Tinoco
2014-06-11 20:46           ` Eric W. Biederman
2014-06-11 21:14             ` Dave Chiluk
2014-06-11 22:52             ` Paul E. McKenney
2014-06-11 23:12               ` Eric W. Biederman
2014-06-11 23:49                 ` Paul E. McKenney
2014-06-12  0:14                   ` Eric W. Biederman
2014-06-12  0:25                     ` Rafael Tinoco
2014-06-12  1:09                       ` Eric W. Biederman
2014-06-12  1:14                         ` Rafael Tinoco
     [not found]                           ` <CAJE_dJzjcWP=e_CPM1M64URVHiEFFb+fP6g2YKZVdoFntkQMZg@mail.gmail.com>
2014-06-13 18:22                             ` Rafael Tinoco
2014-06-14  0:02                             ` Eric W. Biederman
2014-06-16 15:01                               ` Rafael Tinoco
2014-07-17 12:05                                 ` Rafael David Tinoco
2014-07-24  7:01                                   ` Eric W. Biederman

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=87r42v2mjy.fsf@x220.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=chiluk@canonical.com \
    --cc=chris.j.arges@canonical.com \
    --cc=davem@davemloft.net \
    --cc=jay.vosburgh@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rafael.tinoco@canonical.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

Powered by JetHome