Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org, dave.taht@gmail.com
Subject: Re: [PATCH net-next v2] net_sched: qdisc_alloc_handle() can be too slow
Date: Tue, 03 Jan 2012 13:03:53 -0500 (EST)	[thread overview]
Message-ID: <20120103.130353.716810185692904362.davem@davemloft.net> (raw)
In-Reply-To: <1325584811.2320.11.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 03 Jan 2012 11:00:11 +0100

> When trying to allocate ~32768 qdiscs using autohandle mechanism, we can
> fill the space managed by kernel (handles in [8000-FFFF]:0000 range)
> 
> But O(N^2) qdisc_alloc_handle() loops 0x10000 times instead of 0x8000
> 
> time tc add qdisc add dev eth0 parent 10:7fff pfifo limit 10
> RTNETLINK answers: Cannot allocate memory
> real    1m54.826s
> user    0m0.000s
> sys     0m0.004s
> 
> INFO: rcu_sched_state detected stall on CPU 0 (t=60000 jiffies)
> 
> Half number of loops, and add a cond_resched() call.
> We hold rtnl at this point.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> CC: Dave Taht <dave.taht@gmail.com>

Applied, thanks Eric.  I always cringed when I looked at this function :)

  parent reply	other threads:[~2012-01-03 18:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-03  9:58 [PATCH net-next] net_sched: qdisc_alloc_handle() can be too slow Eric Dumazet
2012-01-03 10:00 ` [PATCH net-next v2] " Eric Dumazet
2012-01-03 10:23   ` Dave Taht
2012-01-03 18:03   ` David Miller [this message]
2012-01-03 20:34     ` Eric Dumazet

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=20120103.130353.716810185692904362.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=dave.taht@gmail.com \
    --cc=eric.dumazet@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