Re: R/W semaphore changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2006-07-04 at 14:05 +0100, David Howells wrote:
> Arjan van de Ven <[email protected]> wrote:
> 
> > > Please, please, please don't.  R/W semaphores are _not_ permitted to nest.
> > 
> > yet they do in places, there where there is a natural hierarchy..
> 
> Where?  I believe the mm used to but no longer does.
> 
> They still aren't allowed to.  Consider:
> 
> 	CPU 1			CPU 2
> 	=======================	=======================
> 	-->down_read(&A);
> 	<--down_read(&A);
> 				-->down_write(&A);
> 				   --- SLEEPING ---
> 	-->down_read(&A);
> 	   --- DEADLOCKED ---

you mean recursion, while nesting != recursion!
(for examples of nesting see the general lockdep documentation)
With nesting we mean

down_read(&A);
down_read(&B);

where A and B are a similar lock but not the same exact instance (for
example two inode locks of different inodes)


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux