linux/net/core
Herbert Xu 58ec3b4db9 net: Fix netdev_run_todo dead-lock
Benjamin Thery tracked down a bug that explains many instances
of the error

unregister_netdevice: waiting for %s to become free. Usage count = %d

It turns out that netdev_run_todo can dead-lock with itself if
a second instance of it is run in a thread that will then free
a reference to the device waited on by the first instance.

The problem is really quite silly.  We were trying to create
parallelism where none was required.  As netdev_run_todo always
follows a RTNL section, and that todo tasks can only be added
with the RTNL held, by definition you should only need to wait
for the very ones that you've added and be done with it.

There is no need for a second mutex or spinlock.

This is exactly what the following patch does.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-10-07 15:50:03 -07:00
..
Makefile
datagram.c net: skb_copy_datagram_from_iovec() 2008-08-15 19:52:30 -07:00
dev.c net: Fix netdev_run_todo dead-lock 2008-10-07 15:50:03 -07:00
dev_mcast.c
dst.c
ethtool.c
fib_rules.c
filter.c
flow.c
gen_estimator.c Revert "pkt_sched: Protect gen estimators under est_lock." 2008-08-18 22:32:10 -07:00
gen_stats.c
iovec.c
kmap_skb.h
link_watch.c
neighbour.c net: fix missing pneigh entries in the neighbor seq_file code 2008-08-03 01:10:55 -07:00
net-sysfs.c
net-sysfs.h
net_namespace.c
netevent.c
netpoll.c netdev: Fix lockdep warnings in multiqueue configurations. 2008-07-31 16:58:50 -07:00
pktgen.c pktgen: prevent pktgen from using bad tx queue 2008-08-13 15:16:00 -07:00
request_sock.c net: convert BUG_TRAP to generic WARN_ON 2008-07-25 21:43:18 -07:00
rtnetlink.c net: Fix netdev_run_todo dead-lock 2008-10-07 15:50:03 -07:00
scm.c
skbuff.c net: Preserve netfilter attributes in skb_gso_segment using __copy_skb_header 2008-08-15 19:51:36 -07:00
sock.c
stream.c net: convert BUG_TRAP to generic WARN_ON 2008-07-25 21:43:18 -07:00
sysctl_net_core.c printk ratelimiting rewrite 2008-07-25 10:53:29 -07:00
user_dma.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-07-26 20:17:56 -07:00
utils.c printk ratelimiting rewrite 2008-07-25 10:53:29 -07:00