netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Anton Aksola <aakso@iki.fi>
Cc: netdev@vger.kernel.org, nicolas.dichtel@6wind.com, vadim4j@gmail.com
Subject: Re: [PATCH v3] iproute2: build nsid-name cache only for commands that need it
Date: Sun, 9 Oct 2016 18:57:40 -0700	[thread overview]
Message-ID: <20161009185740.31727206@xeon-e3> (raw)
In-Reply-To: <20160920060123.GA17211@toys.tundra.dog-lvm.novalocal>

On Tue, 20 Sep 2016 06:01:27 +0000
Anton Aksola <aakso@iki.fi> wrote:

> The calling of netns_map_init() before command parsing introduced
> a performance issue with large number of namespaces.
> 
> As commands such as add, del and exec do not need to iterate through
> /var/run/netns it would be good not no build the cache before executing
> these commands.
> 
> Example:
> unpatched:
> time seq 1 1000 | xargs -n 1 ip netns add
> 
> real    0m16.832s
> user    0m1.350s
> sys    0m15.029s
> 
> patched:
> time seq 1 1000 | xargs -n 1 ip netns add
> 
> real    0m3.859s
> user    0m0.132s
> sys    0m3.205s
> 
> Signed-off-by: Anton Aksola <aakso@iki.fi>
> ---
>  ip/ip_common.h                            |  1 +
>  ip/ipmonitor.c                            |  1 +
>  ip/ipnetns.c                              | 31 ++++++++++++++++++++++---------
>  testsuite/tests/ip/netns/set_nsid.t       | 22 ++++++++++++++++++++++
>  testsuite/tests/ip/netns/set_nsid_batch.t | 18 ++++++++++++++++++
>  5 files changed, 64 insertions(+), 9 deletions(-)
>  create mode 100755 testsuite/tests/ip/netns/set_nsid.t
>  create mode 100755 testsuite/tests/ip/netns/set_nsid_batch.t
> 

Applied to net-next (ie for 4.9)

      parent reply	other threads:[~2016-10-10  1:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-20  6:01 [PATCH v3] iproute2: build nsid-name cache only for commands that need it Anton Aksola
2016-09-20 12:52 ` Nicolas Dichtel
2016-10-10  1:57 ` Stephen Hemminger [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=20161009185740.31727206@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=aakso@iki.fi \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=vadim4j@gmail.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).