public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* deadlock caused by printk
@ 2011-03-25 12:15 Ming Lei
  2011-03-25 12:21 ` Peter Zijlstra
  0 siblings, 1 reply; 7+ messages in thread
From: Ming Lei @ 2011-03-25 12:15 UTC (permalink / raw)
  To: torvalds, Peter Zijlstra, Ingo Molnar; +Cc: Linux Kernel Mailing List

Hi,

These days I was studying "perf code" and try to dump some debug
info in event_sched_out(): kernel/perf_event.c by printk, but found
system can hang easily.

After digging into related code for several days, I find the hang is
caused by spinlock deadlock when acquiring rq->lock in task_rq_lock(),
which is called in the path below:

          try_to_wake_up<-wake_up_process<-up<-console_unlock<-printk.

I wonder if there are some usage conventions about printk, which says
explicitly that printk can not by used in some places of kernel. Or does the
above show that it is a bug of kernel?

If the above is really a limitation of printk, have we other dump functions
which may be used safely in some places of kernel source code where
printk is not allowed.

thanks,
-- 
Lei Ming

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-03-25 18:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-25 12:15 deadlock caused by printk Ming Lei
2011-03-25 12:21 ` Peter Zijlstra
2011-03-25 12:26   ` Peter Zijlstra
2011-03-25 14:30     ` Ming Lei
2011-03-25 14:50       ` Peter Zijlstra
2011-03-25 18:41         ` Steven Rostedt
2011-03-25 18:40     ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox