linux hangs with printk on schedule()
A message that is not in the archive (sent off-list or not yet received): 05db01c2cbe5$4b4c34f0$9c2a3b80@zhengthinkpad.suse.lists.linux.kernel
Quoted 7 lines · Haoqiang Zheng
I found Linux hangs when printk is inserted to the function
schedule(). Sure, it doesn't make much sense to add such a line toschedule(). 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