Re: [PATCH] printk deadlocks if called with runqueue lock held

Jiri Kosina
2008-01-18T11:05:51Z

On Thu, 17 Jan 2008, Steven Rostedt wrote:

> Thinking that it was locking up on my code I went looking down the wrong
> path. I finally found (after examining an NMI dump) that the lockup
> happened because printk was trying to wakeup the klogd daemon, which
> caused a deadlock when the try_to_wakeup code tries to grab the runqueue
> lock.

... which I have documented in the printk() comment's in commit 1492192b
:)

> Since printks are seldom called with interrupts disabled, we can
> hold off the waking of klogd if they are. We don't have access to
> the runqueue locks from printk, but those locks need interrupts
> disabled in order to be held.

If this patch is going to be merged, you should perhaps adjust the comment
introduced by the above mentioned commit, so that it reflects the new
behavior.

Thanks,

--
Jiri Kosina