Commit 3fa7c794fe4dc127f7fac3fad4d13628e68f89ce
Committed by
 Andi Kleen
1 parent
5a1b3999d6
Exists in
master
and in
4 other branches
[PATCH] Avoid recursion in lockdep when stack tracer takes locks
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>
Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff
kernel/lockdep.c
| ... | ... | @@ -227,7 +227,11 @@ | 
| 227 | 227 | trace->skip = 3; | 
| 228 | 228 | trace->all_contexts = 0; | 
| 229 | 229 | |
| 230 | + /* Make sure to not recurse in case the the unwinder needs to tak | |
| 231 | +e locks. */ | |
| 232 | + lockdep_off(); | |
| 230 | 233 | save_stack_trace(trace, NULL); | 
| 234 | + lockdep_on(); | |
| 231 | 235 | |
| 232 | 236 | trace->max_entries = trace->nr_entries; | 
| 233 | 237 |