diff options
author | Dmitry Mishin <dim@openvz.org> | 2006-08-09 02:25:54 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-08-09 02:25:54 -0700 |
commit | 7c91767a6b701543c93ebcd611dab61deff3dad1 (patch) | |
tree | 5ccc47d32641d1dacff118bb6b4f7256acb8e2dc /Documentation | |
parent | 7b1ba8de569460894efa892457af7a37c0d574f9 (diff) | |
download | op-kernel-dev-7c91767a6b701543c93ebcd611dab61deff3dad1.zip op-kernel-dev-7c91767a6b701543c93ebcd611dab61deff3dad1.tar.gz |
[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>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions