public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* lockdep warning when nesting dm devices
@ 2006-07-15 11:17 Peter Osterlund
  2006-07-17  2:45 ` Alasdair G Kergon
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Osterlund @ 2006-07-15 11:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arjan van de Ven, dm-devel

If I run this as root:

# dd if=/dev/zero of=tmpfile bs=1M count=10
# /sbin/losetup -f ./tmpfile
# echo "0 10000 linear /dev/loop0 0" | /sbin/dmsetup create test
# echo "0 10000 linear /dev/mapper/test 0" | /sbin/dmsetup create test2

I get the following warning from the lockdep validator.

Btw, is there a limit on how many dm devices can be chained? I guess
there will be a kernel stack overflow if you try to chain together too
many devices.

=============================================
[ INFO: possible recursive locking detected ]
---------------------------------------------
vol_id/2468 is trying to acquire lock:
 (&md->io_lock){----}, at: [<e08475b6>] dm_request+0x23/0x158 [dm_mod]

but task is already holding lock:
 (&md->io_lock){----}, at: [<e08475b6>] dm_request+0x23/0x158 [dm_mod]

other info that might help us debug this:
1 lock held by vol_id/2468:
 #0:  (&md->io_lock){----}, at: [<e08475b6>] dm_request+0x23/0x158 [dm_mod]

stack backtrace:
 [<c01041bc>] show_trace_log_lvl+0x133/0x14d
 [<c01048e4>] show_trace+0x1b/0x1d
 [<c01049b2>] dump_stack+0x26/0x28
 [<c0134b92>] __lock_acquire+0x8aa/0xd29
 [<c013535e>] lock_acquire+0x68/0x83
 [<c01314ff>] down_read+0x50/0x60
 [<e08475b6>] dm_request+0x23/0x158 [dm_mod]
 [<c01e02e8>] generic_make_request+0x94/0x322
 [<e084649a>] __map_bio+0x75/0x130 [dm_mod]
 [<e08472e0>] __split_bio+0x382/0x3c1 [dm_mod]
 [<e0847670>] dm_request+0xdd/0x158 [dm_mod]
 [<c01e02e8>] generic_make_request+0x94/0x322
 [<c01e2a3b>] submit_bio+0x6f/0x112
 [<c01647a1>] submit_bh+0xce/0x11f
 [<c0167902>] block_read_full_page+0x26c/0x2e2
 [<c016a74a>] blkdev_readpage+0x19/0x1b
 [<c014c5ba>] __do_page_cache_readahead+0x1bf/0x28a
 [<c014c6e2>] blockable_page_cache_readahead+0x5d/0xc4
 [<c014c961>] page_cache_readahead+0x176/0x1bc
 [<c01466c7>] do_generic_mapping_read+0x49d/0x50d
 [<c0147084>] __generic_file_aio_read+0xfd/0x22c
 [<c0148491>] generic_file_read+0x9e/0xbe
 [<c0163460>] vfs_read+0x98/0x115
 [<c0163869>] sys_read+0x47/0x6e
 [<c0103069>] sysenter_past_esp+0x56/0x8d
 [<b7f79410>] 0xb7f79410

-- 
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340

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

* Re: lockdep warning when nesting dm devices
  2006-07-15 11:17 lockdep warning when nesting dm devices Peter Osterlund
@ 2006-07-17  2:45 ` Alasdair G Kergon
  2006-07-17  9:16   ` Arjan van de Ven
  0 siblings, 1 reply; 3+ messages in thread
From: Alasdair G Kergon @ 2006-07-17  2:45 UTC (permalink / raw)
  To: Peter Osterlund
  Cc: linux-kernel, Arjan van de Ven, dm-devel, Ingo Molnar, Milan Broz,
	Jun'ichi Nomura

On Sat, Jul 15, 2006 at 01:17:29PM +0200, Peter Osterlund wrote:
> # echo "0 10000 linear /dev/loop0 0" | /sbin/dmsetup create test
> # echo "0 10000 linear /dev/mapper/test 0" | /sbin/dmsetup create test2
 
> I get the following warning from the lockdep validator.
> =============================================
> [ INFO: possible recursive locking detected ]
> ---------------------------------------------

Well at first sight the message is simply pointing out something expected - it
only say "INFO" after all - viz. recursive use of
	down_read(&md->io_lock);
something tied up with the split_bio horridness which needs to go away some
day.  The lock prevents any attempt to suspend the device from happening
while a bio is in the process of being split into other bios.

Of course it's always helpful to review code from different perspectives
like this to look out for any gotchas and we ought to re-check the use
of this lock.

> Btw, is there a limit on how many dm devices can be chained? I guess
> there will be a kernel stack overflow if you try to chain together too
> many devices.

There's a patch in -mm which tackles that, but it needs some changes to dm
(which Milan Broz has begun working on) before it will behave correctly in all
cases.
 
Alasdair
-- 
agk@redhat.com

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

* Re: lockdep warning when nesting dm devices
  2006-07-17  2:45 ` Alasdair G Kergon
@ 2006-07-17  9:16   ` Arjan van de Ven
  0 siblings, 0 replies; 3+ messages in thread
From: Arjan van de Ven @ 2006-07-17  9:16 UTC (permalink / raw)
  To: Alasdair G Kergon
  Cc: Peter Osterlund, linux-kernel, dm-devel, Ingo Molnar, Milan Broz,
	Jun'ichi Nomura

On Mon, 2006-07-17 at 03:45 +0100, Alasdair G Kergon wrote:
> On Sat, Jul 15, 2006 at 01:17:29PM +0200, Peter Osterlund wrote:
> > # echo "0 10000 linear /dev/loop0 0" | /sbin/dmsetup create test
> > # echo "0 10000 linear /dev/mapper/test 0" | /sbin/dmsetup create test2
>  
> > I get the following warning from the lockdep validator.
> > =============================================
> > [ INFO: possible recursive locking detected ]
> > ---------------------------------------------
> 
> Well at first sight the message is simply pointing out something expected - it
> only say "INFO" after all - viz. recursive use of
> 	down_read(&md->io_lock);

is this indeed the same io_lock? Because if it is it's a serious
deadlock; rwsem's are NOT self-recursive!

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

end of thread, other threads:[~2006-07-17  9:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-15 11:17 lockdep warning when nesting dm devices Peter Osterlund
2006-07-17  2:45 ` Alasdair G Kergon
2006-07-17  9:16   ` Arjan van de Ven

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