[lkml]   [2008]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [git pull] scheduler fixes
From: David Miller <>
Date: Thu, 31 Jul 2008 15:55:04 -0700 (PDT)

> I am absolutely sure, I spent the whole night yesterday trying to
> debug this.

Followup. I lost two days of my life debugging this because seemingly
nobody can friggin' agree on what to do about the "printk() wakeup
issue". Thanks!

Can we fix this now, please?

The problem was that Peter's patch triggers a print_deadlock_bug()
in lockdep.c on the runqueue locks.

But those printk()'s quickly want to do a wakeup, which wants to
take the runqueue lock this thread already holds. So I would only
get the first line of the lockdep debugging followed by a complete

Doing these wakeups in such a BUG message is unwise. Please can
we apply something like the following and save other developers
countless wasted hours of their time?

Thanks :-)


debug_locks: Set oops_in_progress if we will log messages.

Otherwise lock debugging messages on runqueue locks can deadlock the
system due to the wakeups performed by printk().

Signed-off-by: David S. Miller <>

diff --git a/lib/debug_locks.c b/lib/debug_locks.c
index 0ef01d1..0218b46 100644
--- a/lib/debug_locks.c
+++ b/lib/debug_locks.c
@@ -8,6 +8,7 @@
* Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <>
+#include <linux/kernel.h>
#include <linux/rwsem.h>
#include <linux/mutex.h>
#include <linux/module.h>
@@ -37,6 +38,7 @@ int debug_locks_off(void)
if (xchg(&debug_locks, 0)) {
if (!debug_locks_silent) {
+ oops_in_progress = 1;
return 1;

 \ /
  Last update: 2008-08-01 10:13    [W:0.094 / U:0.268 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site