Thread (2 messages) 2 messages, 2 authors, 2004-02-08

Re: Documentation/vm/locking: why not hold two PT locks?

From: Robert Love <hidden>
Date: 2004-02-08 21:29:38

On Sun, 2004-02-08 at 16:18 -0500, Ed L Cashin wrote:
Hi.  Documentation/vm/locking says one must not simultaneously hold
the page table lock on mm A and mm B.  Is that true?  Where is the
danger?
There isn't a proscribed lock ordering hierarchy, so you can deadlock.

Assume thread 1 obtains the lock on mm A.

Assume thread 2 obtains the lock on mm B.

Assume thread 1 now obtains the lock on mm B - it is taken, so spin
waiting.

Assume thread 2 now obtains the lock on mm A - it too is taken, so spin
waiting.

Boom..

	Robert Love




--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help