From: Linus Torvalds Date: Mon, 24 Mar 2008 18:07:15 +0000 (-0700) Subject: Don't 'printk()' while holding xtime lock for writing X-Git-Tag: v2.6.25-rc7~28 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92896bd9fd75b1c993b92874d339a8088bb75560;p=linux-2.6 Don't 'printk()' while holding xtime lock for writing The printk() can deadlock because it can wake up klogd(), and task enqueueing will try to read the time in order to set a hrtimer. Reported-by: Marcin Slusarz Debugged-by: Peter Zijlstra Cc: Ingo Molnar Cc: Thomas Gleixner Signed-off-by: Linus Torvalds --- diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 671af612b7..a3fa587c35 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -191,8 +191,12 @@ static void change_clocksource(void) tick_clock_notify(); + /* + * We're holding xtime lock and waking up klogd would deadlock + * us on enqueue. So no printing! printk(KERN_INFO "Time: %s clocksource has been installed.\n", clock->name); + */ } #else static inline void change_clocksource(void) { }