[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.58.0804171223250.13261@gandalf.stny.rr.com>
Date: Thu, 17 Apr 2008 12:24:35 -0400 (EDT)
From: Steven Rostedt <rostedt@...dmis.org>
To: LKML <linux-kernel@...r.kernel.org>
cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...e.hu>
Subject: [RFC PATCH] lockdep: update lockdep_recursion on graph_lock
With the introduction of ftrace, it is possible to recurse into
the lockdep functions via the mcount call. To prevent possible
lockups, updating the lockdep_recursion counter on grabbing the internal
lockdep_lock should prevent deadlocks.
Signed-off-by: Steven Rostedt <srostedt@...hat.com>
---
kernel/lockdep.c | 3 +++
1 file changed, 3 insertions(+)
Index: linux-sched-devel.git/kernel/lockdep.c
===================================================================
--- linux-sched-devel.git.orig/kernel/lockdep.c 2008-04-17 11:20:49.000000000 -0400
+++ linux-sched-devel.git/kernel/lockdep.c 2008-04-17 11:36:48.000000000 -0400
@@ -82,6 +82,8 @@ static int graph_lock(void)
__raw_spin_unlock(&lockdep_lock);
return 0;
}
+ /* prevent any recursions within lockdep from causing deadlocks */
+ current->lockdep_recursion++;
return 1;
}
@@ -90,6 +92,7 @@ static inline int graph_unlock(void)
if (debug_locks && !__raw_spin_is_locked(&lockdep_lock))
return DEBUG_LOCKS_WARN_ON(1);
+ current->lockdep_recursion--;
__raw_spin_unlock(&lockdep_lock);
return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists