Eric Dumazet fa0f5aa743 net_sched: qdisc_alloc_handle() can be too slow
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-03 13:03:20 -05:00
..
2011-12-14 02:39:30 -05:00
2011-12-16 15:07:28 -05:00
2011-03-17 11:59:32 +11:00
2011-12-11 18:25:16 -05:00
2011-11-26 15:57:36 -05:00
2011-09-16 19:20:20 -04:00
2011-12-11 18:25:16 -05:00
2011-11-14 00:10:50 -05:00
2011-12-16 15:49:52 -05:00
2010-10-15 15:53:27 +02:00