mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: David Collins <collinsd@codeaurora.org>,
	Liam Girdwood <lrg@slimlogic.co.uk>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: Deadlock scenario in regulator core
Date: Tue, 22 Mar 2011 20:38:54 -0400	[thread overview]
Message-ID: <1300840734.14261.72.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <20110323000100.GB2529@opensource.wolfsonmicro.com>

On Wed, 2011-03-23 at 00:01 +0000, Mark Brown wrote:
> On Tue, Mar 22, 2011 at 07:19:58PM -0400, Steven Rostedt wrote:
> 
> > Looks to me that the mutex_lock() in _notifier_call_chain needs to be a
> > mutex_lock_nested().
> 
> > The "_nested()" versions are when you have the same type of mutex taken
> > but belonging to two different instances. Like you have here:
> 
> What's a mutex type?  I have to say this is the first time I've heard of
> mutex types and the documentation in mutex.c and mutex-design.txt isn't
> precisely verbose on what mutex_lock_nested() is for or how one would
> pick subclass.

Sorry, I said "mutex type" as a synonym to "lock class". A lock class is
pretty much how a lock is defined.

struct foo {
	struct mutex	m;
};


struct foo *func(void)
{
	bar = kzalloc(sizeof(*bar));
	mutex_init(&bar->m);
}


bar is an instance of lock class struct foo.m. If you have:

	a = func();
	b = func();

Both a->m and b->m are an instance of struct foo.m lock class.

There's better documentation about this in the lockdep-design.txt.

-- Steve



  reply	other threads:[~2011-03-23  0:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-22 22:02 David Collins
2011-03-22 22:31 ` Mark Brown
2011-03-22 23:30   ` David Collins
2011-03-22 23:45     ` Mark Brown
2011-03-22 22:37 ` Steven Rostedt
2011-03-22 23:08   ` David Collins
2011-03-22 23:19     ` Steven Rostedt
2011-03-22 23:41       ` David Collins
2011-03-23  0:07         ` Steven Rostedt
2011-03-23  0:11           ` Mark Brown
2011-03-25 10:55           ` Peter Zijlstra
2011-03-23  0:01       ` Mark Brown
2011-03-23  0:38         ` Steven Rostedt [this message]
2011-03-23 10:42           ` Mark Brown
2011-03-25 10:59             ` Peter Zijlstra
2011-03-22 22:43 ` Mark Brown

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=1300840734.14261.72.camel@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=collinsd@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.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®