mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: David Howells <dhowells@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	torvalds@osdl.org, akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: R/W semaphore changes
Date: Tue, 04 Jul 2006 15:17:25 +0200	[thread overview]
Message-ID: <1152019045.3109.53.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <15345.1152018339@warthog.cambridge.redhat.com>

On Tue, 2006-07-04 at 14:05 +0100, David Howells wrote:
> Arjan van de Ven <arjan@infradead.org> 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)



  reply	other threads:[~2006-07-04 13:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-04 12:47 David Howells
2006-07-04 12:52 ` Arjan van de Ven
2006-07-04 13:05 ` David Howells
2006-07-04 13:17   ` Arjan van de Ven [this message]
2006-07-04 13:21   ` Ingo Molnar
2006-07-04 13:33     ` [patch] lockdep: add more rwsem.h documentation Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1152019045.3109.53.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=akpm@osdl.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®