[PATCH] Avoid recursion in lockdep when stack tracer takes locks
authorAndi Kleen <ak@suse.de>
Tue, 26 Sep 2006 08:52:34 +0000 (10:52 +0200)
committerAndi Kleen <andi@basil.nowhere.org>
Tue, 26 Sep 2006 08:52:34 +0000 (10:52 +0200)
The new dwarf2 unwinder needs to take locks to do backtraces
inside modules. This patch makes sure lockdep which calls
stacktrace is not reentered.

Thanks to Ingo for suggesting this simpler approach.

Cc: mingo@elte.hu
Signed-off-by: Andi Kleen <ak@suse.de>
kernel/lockdep.c

index 900b4cb..c088e55 100644 (file)
@@ -227,7 +227,11 @@ static int save_trace(struct stack_trace *trace)
        trace->skip = 3;
        trace->all_contexts = 0;
 
+       /* Make sure to not recurse in case the the unwinder needs to tak
+e         locks. */
+       lockdep_off();
        save_stack_trace(trace, NULL);
+       lockdep_on();
 
        trace->max_entries = trace->nr_entries;