Skip to content

Commit

Permalink
[PATCH] Avoid recursion in lockdep when stack tracer takes locks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Sep 26, 2006
1 parent 5a1b399 commit 3fa7c79
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/lockdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 3fa7c79

Please sign in to comment.