Messages in this thread Patch in this message | | | Date | Mon, 24 Mar 2008 13:24:26 +0100 | From | Peter Zijlstra <> | 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 --
| |