linux/net/core
Dmitry Mishin 7c91767a6b [NET]: add_timer -> mod_timer() in dst_run_gc()
Patch from Dmitry Mishin <dim@openvz.org>:

Replace add_timer() by mod_timer() in dst_run_gc
in order to avoid BUG message.

       CPU1                            CPU2
dst_run_gc()  entered           dst_run_gc() entered
spin_lock(&dst_lock)                   .....
del_timer(&dst_gc_timer)         fail to get lock
       ....                         mod_timer() <--- puts 
                                                 timer back
                                                 to the list
add_timer(&dst_gc_timer) <--- BUG because timer is in list already.

Found during OpenVZ internal testing.

At first we thought that it is OpenVZ specific as we
added dst_run_gc(0) call in dst_dev_event(),
but as Alexey pointed to me it is possible to trigger
this condition in mainstream kernel.

F.e. timer has fired on CPU2, but the handler was preeempted
by an irq before dst_lock is tried.
Meanwhile, someone on CPU1 adds an entry to gc list and
starts the timer.
If CPU2 was preempted long enough, this timer can expire
simultaneously with resuming timer handler on CPU1, arriving
exactly to the situation described.

Signed-off-by: Dmitry Mishin <dim@openvz.org>
Signed-off-by: Kirill Korotaev <dev@openvz.org>
Signed-off-by: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-08-09 02:25:54 -07:00
..
datagram.c [PATCH] POLLRDHUP/EPOLLRDHUP handling for half-closed devices notifications 2006-03-25 08:22:56 -08:00
dev_mcast.c [NET]: Add netif_tx_lock 2006-06-17 21:30:14 -07:00
dev.c [NET]: Fix more per-cpu typos 2006-08-02 15:02:31 -07:00
dst.c [NET]: add_timer -> mod_timer() in dst_run_gc() 2006-08-09 02:25:54 -07:00
dv.c [NET]: More kzalloc conversions. 2006-04-09 22:25:48 -07:00
ethtool.c [NET] ethtool: fix oops by testing correct struct member 2006-07-17 12:54:40 -04:00
filter.c unaligned access in sk_run_filter() 2006-04-18 15:57:54 -07:00
flow.c [PATCH] for_each_possible_cpu: network codes 2006-04-11 06:18:31 -07:00
gen_estimator.c [NET]: More kzalloc conversions. 2006-04-09 22:25:48 -07:00
gen_stats.c
iovec.c
link_watch.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
Makefile [NET]: Core net changes to generate netevents 2006-08-02 13:38:21 -07:00
neighbour.c [NET]: Core net changes to generate netevents 2006-08-02 13:38:21 -07:00
net-sysfs.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
netevent.c [NET]: Network Event Notifier Mechanism. 2006-08-02 13:38:20 -07:00
netpoll.c [NET] netpoll: break recursive loop in netpoll rx path 2006-06-26 00:04:27 -07:00
pktgen.c [PKTGEN]: Make sure skb->{nh,h} are initialized in fill_packet_ipv6() too. 2006-08-07 20:52:10 -07:00
request_sock.c [NET]: More kzalloc conversions. 2006-04-09 22:25:48 -07:00
rtnetlink.c [RTNETLINK]: Fix IFLA_ADDRESS handling. 2006-08-08 16:47:37 -07:00
scm.c [PATCH] capable/capability.h (net/) 2006-01-11 18:42:14 -08:00
skbuff.c [NET]: Assign skb->dev in netdev_alloc_skb 2006-08-07 16:09:04 -07:00
sock.c [PATCH] lockdep: annotate sk_locks 2006-07-03 15:27:10 -07:00
stream.c [NET]: fix __sk_stream_mem_reclaim 2006-07-12 17:58:53 -07:00
sysctl_net_core.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
user_dma.c [I/OAT]: net/core/user_dma.c should #include <net/netdma.h> 2006-07-21 14:49:49 -07:00
utils.c [PATCH] for_each_possible_cpu: network codes 2006-04-11 06:18:31 -07:00
wireless.c [PATCH] wext: Fix RtNetlink ENCODE security permissions 2006-04-19 17:25:41 -04:00