lkml.org 
[lkml]   [2003]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: linux hangs with printk on schedule()
From
Date
"Haoqiang Zheng" <hzheng@cs.columbia.edu> writes:

> I found Linux hangs when printk is inserted to the function schedule().
> Sure, it doesn't make much sense to add such a line to schedule(). But Linux
> shouldn't hang anyway, right? It's assumed that printk can be inserted
> safely to anywhere. So, is it a bug of Linux?
>
> The linux I am running is 2.4.18-14, the same version used by Redhat 8.0.
> The scheduler is Ingo's O(1) scheduler.

printk can call wake_up to wake up the klogd daemon. This will deadlock
on aquiring the scheduler lock of the local run queue.

One way to avoid it is to wrap it like this:

oops_in_progress++;
printk(...);
oops_in_progress--;

And no, it's not a bug in Linux.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.042 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site