Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] net_sched: qdisc_alloc_handle() can be too slow
@ 2012-01-03  9:58 Eric Dumazet
  2012-01-03 10:00 ` [PATCH net-next v2] " Eric Dumazet
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2012-01-03  9:58 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Dave Taht

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>
---
Next move is using rb-tree instead of a linked list, to speedup
qdisc_lookup(). A complex qdisc setup is way too slow.

 net/sched/sch_api.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-03 20:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2012-01-03 20:34     ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox