mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
To: "Jiri Kosina" <jikos@jikos.cz>
Cc: "Arjan van de Ven" <arjan@infradead.org>,
	lkml <linux-kernel@vger.kernel.org>,
	"Ingo Molnar" <mingo@elte.hu>
Subject: Re: [PATCH 0/3] Synaptics - fix lockdep warnings
Date: Fri, 15 Sep 2006 09:56:46 -0400	[thread overview]
Message-ID: <d120d5000609150656v544ca0d6vcf93e349508dedd8@mail.gmail.com> (raw)
In-Reply-To: <d120d5000609150651m4b7e739bv7afc0683071911a1@mail.gmail.com>

On 9/15/06, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On 9/15/06, Jiri Kosina <jikos@jikos.cz> wrote:
> > On Fri, 15 Sep 2006, Dmitry Torokhov wrote:
> >
> > > I understand what Ingo is saying about detecting deadlocks across the
> > > pool of locks of the same class not waiting till they really clash, it
> > > is really useful. I also want to make my code as independent of lockdep
> > > as possible. Having a speciall marking on the locks themselves (done
> > > upon creation) instead of altering call sites is the cleanest way IMHO.
> > > Can we have a flag in the lock structure that would tell lockdep that it
> > > is OK for the given lock to be taken several times (i.e. the locks are
> > > really on the different objects)? This would still allow to detect
> > > incorrect locking across different classes.
> >
> > Yes, but unfortunately marking the lock as 'can-be-taken-multiple-times'
> > is weaker than using the nested locking provided by lockdep.
> >
> > i.e. if you mark a lock this way, it opens door for having deadlock, which
> > won't be detected by lockdep. This will happen if the code, by mistake,
> > really takes the _very same_ lock twice. lockdep will not be able to
> > detect this, when the lock is marked in a way you propose, but is able to
> > detect this when using the nested semantics.
> >
>
> But nested semantics breaks the notion of the locks belonging to the
> same pool so both solutions have tradeoffs. I could use either one of
> these as long as details are hidden and callers do not have to care.
>

One more thing I forgot to add - how will we deal with lockdep in
cases when we have X-over-Y-over-X protocol, when there is no tight
coupling between the X parts so it is impossible to know when to apply
special marking on the lock or callers?

-- 
Dmitry

  reply	other threads:[~2006-09-15 13:56 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-14  0:44 Jiri Kosina
2006-09-14  0:44 ` [PATCH 1/3] " Jiri Kosina
2006-09-14  0:44   ` [PATCH 2/3] " Jiri Kosina
2006-09-14  0:44     ` [PATCH 3/3] " Jiri Kosina
2006-09-14  2:00 ` [PATCH 0/3] " Dmitry Torokhov
2006-09-14  8:43   ` Jiri Kosina
2006-09-14 13:18     ` Dmitry Torokhov
2006-09-14 14:39       ` Jiri Kosina
2006-09-14 14:58         ` Dmitry Torokhov
2006-09-14 15:03           ` Arjan van de Ven
2006-09-14 15:08           ` Jiri Kosina
2006-09-14 15:51             ` Dmitry Torokhov
2006-09-14 16:00               ` Jiri Kosina
2006-09-14 16:18                 ` Dmitry Torokhov
2006-09-14 18:48                   ` Jiri Kosina
2006-09-14 18:56                     ` Dmitry Torokhov
2006-09-14 19:03                       ` Arjan van de Ven
2006-09-14 19:11                         ` Dmitry Torokhov
2006-09-15  5:33                           ` Arjan van de Ven
2006-09-15 13:20                             ` Dmitry Torokhov
2006-09-15 13:38                               ` Jiri Kosina
2006-09-15 13:51                                 ` Dmitry Torokhov
2006-09-15 13:56                                   ` Dmitry Torokhov [this message]
2006-09-14 19:56                       ` 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=d120d5000609150656v544ca0d6vcf93e349508dedd8@mail.gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=arjan@infradead.org \
    --cc=jikos@jikos.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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®