lkml.org 
[lkml]   [2008]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2/2] time: xtime lock vs printk
This printk() can deadlock because it can wake up klogd(), and
task enqueueing will try to read the time in order to set a hrtimer.

Use the new printk_nowakeup() which will avoid waking klogd.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
kernel/time/timekeeping.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

Index: linux-2.6-2/kernel/time/timekeeping.c
===================================================================
--- linux-2.6-2.orig/kernel/time/timekeeping.c
+++ linux-2.6-2/kernel/time/timekeeping.c
@@ -191,7 +191,11 @@ static void change_clocksource(void)

tick_clock_notify();

- printk(KERN_INFO "Time: %s clocksource has been installed.\n",
+ /*
+ * We're holding xtime lock and waking up klogd would deadlock
+ * us on enqueue. Print without waking.
+ */
+ printk_nowakeup(KERN_INFO "Time: %s clocksource has been installed.\n",
clock->name);
}
#else
--



\
 
 \ /
  Last update: 2008-03-24 13:43    [W:0.111 / U:1.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site