diff options
author | Arjan van de Ven <arjan@Linux.intel.com> | 2006-07-10 07:44:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-10 16:24:14 -0400 |
commit | 55794a412fdf9af1744800e5020a4ec6b21e3cdc (patch) | |
tree | 3429cb26c5dfd484487b15827c655b5d080ce0f8 | |
parent | 5fca80e8b4bf5d69b900115b14342133ce81d79e (diff) |
[PATCH] lockdep: improve debug output
Make lockdep print which lock is held, in the "kfree() of a live lock"
scenario.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | kernel/lockdep.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 42af5cc31a4..c1f34addd00 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -2551,7 +2551,7 @@ static inline int in_range(const void *start, const void *addr, const void *end) | |||
2551 | 2551 | ||
2552 | static void | 2552 | static void |
2553 | print_freed_lock_bug(struct task_struct *curr, const void *mem_from, | 2553 | print_freed_lock_bug(struct task_struct *curr, const void *mem_from, |
2554 | const void *mem_to) | 2554 | const void *mem_to, struct held_lock *hlock) |
2555 | { | 2555 | { |
2556 | if (!debug_locks_off()) | 2556 | if (!debug_locks_off()) |
2557 | return; | 2557 | return; |
@@ -2563,6 +2563,7 @@ print_freed_lock_bug(struct task_struct *curr, const void *mem_from, | |||
2563 | printk( "-------------------------\n"); | 2563 | printk( "-------------------------\n"); |
2564 | printk("%s/%d is freeing memory %p-%p, with a lock still held there!\n", | 2564 | printk("%s/%d is freeing memory %p-%p, with a lock still held there!\n", |
2565 | curr->comm, curr->pid, mem_from, mem_to-1); | 2565 | curr->comm, curr->pid, mem_from, mem_to-1); |
2566 | print_lock(hlock); | ||
2566 | lockdep_print_held_locks(curr); | 2567 | lockdep_print_held_locks(curr); |
2567 | 2568 | ||
2568 | printk("\nstack backtrace:\n"); | 2569 | printk("\nstack backtrace:\n"); |
@@ -2596,7 +2597,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len) | |||
2596 | !in_range(mem_from, lock_to, mem_to)) | 2597 | !in_range(mem_from, lock_to, mem_to)) |
2597 | continue; | 2598 | continue; |
2598 | 2599 | ||
2599 | print_freed_lock_bug(curr, mem_from, mem_to); | 2600 | print_freed_lock_bug(curr, mem_from, mem_to, hlock); |
2600 | break; | 2601 | break; |
2601 | } | 2602 | } |
2602 | local_irq_restore(flags); | 2603 | local_irq_restore(flags); |