lkml.org 
[lkml]   [2003]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: recursive spinlocks. Shoot.
On Thu, May 22, 2003 at 06:42:15AM +0200, Peter T. Breuer wrote:
> "Nick Piggin wrote:"
> > Locking is an implementation issue, and as such I think you'll have
> > to come up with a real problem or some real code. You must have some
> > target problem in mind?
>
> I'll butt back in here.
>
snip

>
> The result was a call from the block driver to the md driver with a
> lock held, and a rather unexpected call back from the md driver that
> impotently tried to take the same lock.
>
> Same thread.
>

OK, in this case, it didn't sound like your block driver
expected to be re-entered. Lucky the problem immediately
caused a deadlock ;)

More seriously, lets say you get around the above with
recursive locks:

Thread 1 Thread 2 (on another cpu)
enter the block driver
take the bd lock
issue an md ioctl
take the md lock
enter the block driver
spin on bd lock
automatically call md ioctl
spin on md lock

So the problem needs a rethink.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:1.169 / U:0.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site