public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yong Zhang <yong.zhang0@gmail.com>
To: Sven Eckelmann <sven@narfation.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org,
	simon.wunderlich@s2003.tu-chemnitz.de,
	Marek Lindner <lindner_marek@yahoo.de>
Subject: Re: Using nested locking for spin_lock_bh
Date: Thu, 29 Mar 2012 11:11:37 +0800	[thread overview]
Message-ID: <20120329031136.GA2062@zhy> (raw)
In-Reply-To: <2108147.Aqyix6xDmB@bentobox>

On Wed, Mar 28, 2012 at 06:36:39PM +0200, Sven Eckelmann wrote:
> Hi,
> 
> I started to run some experimental batman-adv code inside some virtual 
> machines with different debugging functions enabled. One of them was lockdep. 
> There we noticed a false positive for a lock class that is actually used in 
> two different data structures.

Hmm, I think you can initialize the lock class in the two differnent data
structures with differnt lock_class_key.

Thanks,
Yong

> Therefore, lockdep noticed that there could be 
> a deadlock for this class in a function that locks the two different data 
> structures.
> 
> To resolve this problem, I wanted to define two different subclasses and 
> replace the spin_lock_bh with its nested version. The only problem now is the 
> absence of spin_lock_bh_nested. I could only find spin_lock_bh and 
> spin_lock_irqsave_nested.
> 
> Is there another way how this should be done or is there a general problem why 
> there is no nested support for this incarnation of spin_lock?
> 
> Kind regards,
> 	Sven



-- 
Only stand for myself

  reply	other threads:[~2012-03-29  3:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-28 16:36 Using nested locking for spin_lock_bh Sven Eckelmann
2012-03-29  3:11 ` Yong Zhang [this message]
2012-03-29 10:41   ` Sven Eckelmann
2012-04-15 11:18 ` Peter Zijlstra

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=20120329031136.GA2062@zhy \
    --to=yong.zhang0@gmail.com \
    --cc=lindner_marek@yahoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=simon.wunderlich@s2003.tu-chemnitz.de \
    --cc=sven@narfation.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