Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55794a41 authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Linus Torvalds
Browse files

[PATCH] lockdep: improve debug output



Make lockdep print which lock is held, in the "kfree() of a live lock"
scenario.

Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5fca80e8
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -2551,7 +2551,7 @@ static inline int in_range(const void *start, const void *addr, const void *end)


static void
static void
print_freed_lock_bug(struct task_struct *curr, const void *mem_from,
print_freed_lock_bug(struct task_struct *curr, const void *mem_from,
		     const void *mem_to)
		     const void *mem_to, struct held_lock *hlock)
{
{
	if (!debug_locks_off())
	if (!debug_locks_off())
		return;
		return;
@@ -2563,6 +2563,7 @@ print_freed_lock_bug(struct task_struct *curr, const void *mem_from,
	printk(  "-------------------------\n");
	printk(  "-------------------------\n");
	printk("%s/%d is freeing memory %p-%p, with a lock still held there!\n",
	printk("%s/%d is freeing memory %p-%p, with a lock still held there!\n",
		curr->comm, curr->pid, mem_from, mem_to-1);
		curr->comm, curr->pid, mem_from, mem_to-1);
	print_lock(hlock);
	lockdep_print_held_locks(curr);
	lockdep_print_held_locks(curr);


	printk("\nstack backtrace:\n");
	printk("\nstack backtrace:\n");
@@ -2596,7 +2597,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len)
					!in_range(mem_from, lock_to, mem_to))
					!in_range(mem_from, lock_to, mem_to))
			continue;
			continue;


		print_freed_lock_bug(curr, mem_from, mem_to);
		print_freed_lock_bug(curr, mem_from, mem_to, hlock);
		break;
		break;
	}
	}
	local_irq_restore(flags);
	local_irq_restore(flags);