Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Lucian Adrian Grijincu <lucian.grijincu@gmail.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 2/2] net: dummy: allocate devices with alloc_netdev_id
Date: Tue, 07 Jun 2011 05:19:25 +0200	[thread overview]
Message-ID: <1307416765.2642.37.camel@edumazet-laptop> (raw)
In-Reply-To: <1307410786-19110-3-git-send-email-lucian.grijincu@gmail.com>

Le mardi 07 juin 2011 à 04:39 +0300, Lucian Adrian Grijincu a écrit :
> The most like case is that no one else is registering devices with a
> name like "dummy%d".
> 
> We can bring the complexity down by replacing:
> - alloc_netdev_id which is O(N) with
> - alloc_netdev_id which, on the average case, is O(1).
> 
> $ time modprobe dummy numdummies=5000
> - with alloc_netdev   : 9.50s
> - with alloc_netdev_id: 3.50s
> 
> NOTE: Stats generated on a heavily patched 3.0-rc1 which replaces the
>       current O(N^2) sysctl algorithm with a better one.

Yes, and disabled hotplug I guess.

Dont try this on a random computer ;)

# time modprobe dummy numdummies=5000

real	4m45.646s
user	0m0.000s
sys	0m12.440s
# uptime
 05:13:46 up 13:30,  3 users,  load average: 11221.41, 6918.70, 3101.12
# uptime
 05:18:45 up 13:35,  3 users,  load average: 12159.82, 10277.39, 5623.19




  reply	other threads:[~2011-06-07  3:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-07  1:39 [PATCH 0/2] speed up net device allocation using pattern names Lucian Adrian Grijincu
2011-06-07  1:39 ` [PATCH 1/2] net: add alloc_netdev_mqs_id Lucian Adrian Grijincu
2011-06-07  1:39 ` [PATCH 2/2] net: dummy: allocate devices with alloc_netdev_id Lucian Adrian Grijincu
2011-06-07  3:19   ` Eric Dumazet [this message]
2011-06-07  3:38     ` David Miller
2011-06-07  7:49     ` Lucian Adrian Grijincu
2011-06-07  7:59       ` Eric Dumazet
2011-06-07  8:30         ` Lucian Adrian Grijincu
2011-06-07  9:29           ` David Miller
2011-06-09  7:20             ` David Miller

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=1307416765.2642.37.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=lucian.grijincu@gmail.com \
    --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