[lkml]   [2000]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
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->
+ if (timer_pending(timer))
goto bug;
spin_unlock_irqrestore(&timerlist_lock, flags);
+ spin_unlock_irqrestore(&timerlist_lock, flags);
printk("bug: kernel timer added twice at %p.\n",
- 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
Please read the FAQ at

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