lkml.org 
[lkml]   [2000]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] deadlock over timerlist_lock
One can't do a printk() with timerlist_lock held.  This is
because the console code does a mod_timer(), which
acquires timerlist_lock.


--- linux-2.4.0-test7-pre5/kernel/timer.c Fri Aug 11 19:06:13 2000
+++ linux-akpm/kernel/timer.c Sun Aug 20 22:50:26 2000
@@ -180,17 +180,15 @@
unsigned long flags;

spin_lock_irqsave(&timerlist_lock, flags);
- if (timer->list.next)
+ if (timer_pending(timer))
goto bug;
internal_add_timer(timer);
-out:
spin_unlock_irqrestore(&timerlist_lock, flags);
return;
-
bug:
+ spin_unlock_irqrestore(&timerlist_lock, flags);
printk("bug: kernel timer added twice at %p.\n",
__builtin_return_address(0));
- goto out;
}

static inline int detach_timer (struct timer_list *timer)

BTW: this implies that the NMI oopser should bust
timerlist_lock as well as console_lock. Also,
the oops code in do_page_fault() should also bust both
spinlocks before trying to print. And if we're using
a serial console there may be a different set of spinlocks
which need busting. And the fbdev drivers... I'll take
a look.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:37    [W:0.018 / U:10.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site