public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG] scsi/io-elevator held lock freed.
@ 2006-07-04 14:54 Daniel Walker
  2006-07-04 15:13 ` Arjan van de Ven
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Walker @ 2006-07-04 14:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-scsi


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

stack backtrace:
 [<c010546b>] show_trace+0x1b/0x20
 [<c0105494>] dump_stack+0x24/0x30
 [<c013c234>] debug_check_no_locks_freed+0x154/0x190
 [<c016be44>] kfree+0x54/0xb0
 [<c022c0f3>] cfq_exit_queue+0xe3/0x100
 [<c021f6ea>] elevator_exit+0x2a/0x50
 [<c022180b>] blk_cleanup_queue+0x3b/0x50
 [<c02c7ff1>] scsi_free_queue+0x11/0x20
 [<c02cd5ff>] scsi_device_dev_release_usercontext+0xff/0x1a0
 [<c0130975>] execute_in_process_context+0x25/0x60
 [<c02cc433>] scsi_device_dev_release+0x23/0x30
 [<c0298bdd>] device_release+0x1d/0x80
 [<c0230c6c>] kobject_cleanup+0x4c/0x90
 [<c0230cc4>] kobject_release+0x14/0x20
 [<c02312ea>] kref_put+0x3a/0xb0
 [<c0230451>] kobject_put+0x21/0x30
 [<c0298fca>] put_device+0x1a/0x20
 [<c02cae17>] scsi_probe_and_add_lun+0x637/0x9a0
 [<c02cb75f>] __scsi_scan_target+0xef/0x600
 [<c02cbce8>] scsi_scan_channel+0x78/0x90
 [<c02cbd67>] scsi_scan_host_selected+0x67/0xe0
 [<c02cbe12>] scsi_scan_host+0x32/0x40
 [<c02d2d84>] sym2_probe+0x9d4/0xa20
 [<c023c871>] pci_device_probe+0x61/0x80
 [<c029b4be>] driver_probe_device+0x4e/0xe0
 [<c029b653>] __driver_attach+0x73/0x80
 [<c029ada7>] bus_for_each_dev+0x57/0x80
 [<c029b337>] driver_attach+0x27/0x30
 [<c029a916>] bus_add_driver+0x86/0x180
 [<c029b91d>] driver_register+0xad/0xf0
 [<c023c3a5>] __pci_register_driver+0x65/0x90
 [<c05693dc>] sym2_init+0x6c/0x120
 [<c01003e0>] init+0xf0/0x320
 [<c01008e5>] kernel_thread_helper+0x5/0x10



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] scsi/io-elevator held lock freed.
  2006-07-04 14:54 [BUG] scsi/io-elevator held lock freed Daniel Walker
@ 2006-07-04 15:13 ` Arjan van de Ven
  2006-07-04 15:15   ` Ingo Molnar
  2006-07-04 15:24   ` Daniel Walker
  0 siblings, 2 replies; 4+ messages in thread
From: Arjan van de Ven @ 2006-07-04 15:13 UTC (permalink / raw)
  To: Daniel Walker; +Cc: mingo, linux-kernel, linux-scsi

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);



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] scsi/io-elevator held lock freed.
  2006-07-04 15:13 ` Arjan van de Ven
@ 2006-07-04 15:15   ` Ingo Molnar
  2006-07-04 15:24   ` Daniel Walker
  1 sibling, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2006-07-04 15:15 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: Daniel Walker, linux-kernel, linux-scsi


* Arjan van de Ven <arjan@infradead.org> wrote:

> 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.....

i think it's eq->sysfs_lock that is being freed here.

> this patch ought to make it do that; could you at least add this to 
> your kernel?
> 
> Ingo, is this the right approach?

yeah, that's OK.

	Ingo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] scsi/io-elevator held lock freed.
  2006-07-04 15:13 ` Arjan van de Ven
  2006-07-04 15:15   ` Ingo Molnar
@ 2006-07-04 15:24   ` Daniel Walker
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Walker @ 2006-07-04 15:24 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: mingo, linux-kernel, linux-scsi

On Tue, 2006-07-04 at 17:13 +0200, Arjan van de Ven wrote:
> 
> blargh.. it'd be more useful if lockdep actually printed which lock it
> is that it thinks is about to get freed.....

I was thinking exactly the same thing ..

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

I'll add the patch, but I doubt I'll see it again ..

Daniel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-07-04 15:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-04 14:54 [BUG] scsi/io-elevator held lock freed Daniel Walker
2006-07-04 15:13 ` Arjan van de Ven
2006-07-04 15:15   ` Ingo Molnar
2006-07-04 15:24   ` Daniel Walker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox