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 09:59:52 +0200	[thread overview]
Message-ID: <1307433593.3091.3.camel@edumazet-laptop> (raw)
In-Reply-To: <BANLkTi=8mHr=SaUacW5cFR5xqXPaxrg5Xw@mail.gmail.com>

Le mardi 07 juin 2011 à 10:49 +0300, Lucian Adrian Grijincu a écrit :
> On Tue, Jun 7, 2011 at 6:19 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > 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.
> 
> 

Some distros have :

$ cat /proc/sys/kernel/hotplug
/sbin/hotplug

http://linux.die.net/man/8/hotplug

Basically this starts a lot of process when a new device is created.

modprobe dummy numdummies=5000

This previous line ask 5000 asynchronous hotplug start, so it launches
thousands of processes, all fighting to get RTNL because they access
network configuration data.


Please note I was not commenting your patch (it seems fine at a first
glance), only warning people not doing "modprobe dummy numdummies=5000"
without thinking a bit if their machine wont crash or freeze :)




  reply	other threads:[~2011-06-07  8:01 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
2011-06-07  3:38     ` David Miller
2011-06-07  7:49     ` Lucian Adrian Grijincu
2011-06-07  7:59       ` Eric Dumazet [this message]
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=1307433593.3091.3.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