All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ming Lei <tom.leiming@gmail.com>,
	Gautham R Shenoy <ego@in.ibm.com>
Subject: Re: [PATCH 1/2] lockdep: Include recursive read-locks dependencies in the tree
Date: Thu, 19 Nov 2009 17:07:02 +0100	[thread overview]
Message-ID: <20091119160657.GC4967@nowhere> (raw)
In-Reply-To: <1258539965.3918.194.camel@laptop>

On Wed, Nov 18, 2009 at 11:26:05AM +0100, Peter Zijlstra wrote:
> On Wed, 2009-11-18 at 02:06 +0100, Frederic Weisbecker wrote:
> > Currently, recursive read locks are checked in two ways:
> > 
> > - walk through the locks held by the current task and check possible
> >   deadlock.
> > 
> > - if the recursive read lock is not already present in the lock held
> >   by the current task, check its dependencies against the tree.
> > 
> > But this recursive read lock will never be added to the tree of
> > dependencies. It means that the following sequence:
> > 
> > A = rwlock (Ar: taken as read recursive, Aw: taken as write)
> > B = normal lock
> > 
> >  Ar -> B
> >  B  -> Aw
> > 
> > won't ever be detected as a lock inversion.
> > This patch fixes it by inserting the recursive read locks into the
> > tree of dependencies and enhancing the circular checks (check the
> > class and the read attribute collision).
> 
> There were some very funny corner cases with IRQ state vs recursive
> locks, I don't seen any of that mentioned here.


Ah right. I forgot these cases... I probably need to do some other checks
in check_usage().

I'll have a look at it.

Thanks.

 
> Bot ego and I poked at it at various times, but neither of us managed to
> actually finish it due to getting distracted with other bits I guess.
> 
> http://programming.kicks-ass.net/kernel-patches/cpu-hotplug/
> 
> http://lkml.org/lkml/2009/5/11/203



  reply	other threads:[~2009-11-19 16:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18  1:06 [PATCH 0/2] lockdep: Improvements for rwlocks dependency inversion detection Frederic Weisbecker
2009-11-18  1:06 ` [PATCH 1/2] lockdep: Include recursive read-locks dependencies in the tree Frederic Weisbecker
2009-11-18 10:26   ` Peter Zijlstra
2009-11-19 16:07     ` Frederic Weisbecker [this message]
2009-11-18  1:06 ` [PATCH 2/2] lockdep: Don't only check recursive read locks once in a sequence Frederic Weisbecker
2009-11-18  9:43   ` Lai Jiangshan
2009-11-19 15:55     ` Frederic Weisbecker
2009-11-19 17:13       ` Peter Zijlstra
2009-11-20  0:57         ` Frederic Weisbecker

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=20091119160657.GC4967@nowhere \
    --to=fweisbec@gmail.com \
    --cc=ego@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tom.leiming@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.