mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Daniel Walker <dwalker@mvista.com>
Cc: mingo@elte.hu, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [BUG] scsi/io-elevator held lock freed.
Date: Tue, 04 Jul 2006 17:13:30 +0200	[thread overview]
Message-ID: <1152026010.3109.66.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <1152024854.29262.5.camel@c-67-180-134-207.hsd1.ca.comcast.net>

On Tue, 2006-07-04 at 07:54 -0700, Daniel Walker wrote:
> I got this during boot. I booted the same kernel several times, and only
> saw it once. The kernel was 2.6.17-mm5 .
> 
> Daniel
> 
> 
> =========================
> [ BUG: held lock freed! ]
> -------------------------
> swapper/1 is freeing memory f73a8580-f73a867f, with a lock still held there!
> 2 locks held by swapper/1:
>  #0:  (&shost->scan_mutex){--..}, at: [<c0419098>] mutex_lock+0x8/0x10
>  #1:  (&eq->sysfs_lock){--..}, at: [<c0419098>] mutex_lock+0x8/0x10

blargh.. it'd be more useful if lockdep actually printed which lock it
is that it thinks is about to get freed.....

this patch ought to make it do that; could you at least add this to your
kernel?

Ingo, is this the right approach?

---
 kernel/lockdep.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux-2.6.17-mm6/kernel/lockdep.c
===================================================================
--- linux-2.6.17-mm6.orig/kernel/lockdep.c
+++ linux-2.6.17-mm6/kernel/lockdep.c
@@ -2571,7 +2571,7 @@ static inline int in_range(const void *s
 
 static void
 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())
 		return;
@@ -2583,6 +2583,7 @@ print_freed_lock_bug(struct task_struct 
 	printk(  "-------------------------\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);
+	print_lock(hlock);
 	lockdep_print_held_locks(curr);
 
 	printk("\nstack backtrace:\n");
@@ -2616,7 +2617,7 @@ void debug_check_no_locks_freed(const vo
 					!in_range(mem_from, lock_to, mem_to))
 			continue;
 
-		print_freed_lock_bug(curr, mem_from, mem_to);
+		print_freed_lock_bug(curr, mem_from, mem_to, hlock);
 		break;
 	}
 	local_irq_restore(flags);



  reply	other threads:[~2006-07-04 15:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-04 14:54 Daniel Walker
2006-07-04 15:13 ` Arjan van de Ven [this message]
2006-07-04 15:15   ` Ingo Molnar
2006-07-04 15:24   ` Daniel Walker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1152026010.3109.66.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=dwalker@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®