mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
To: "Arjan van de Ven" <arjan@infradead.org>
Cc: "Jiri Kosina" <jikos@jikos.cz>,
	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:20:47 -0400	[thread overview]
Message-ID: <d120d5000609150620p15b17debo9ace17836d788958@mail.gmail.com> (raw)
In-Reply-To: <1158298404.4332.18.camel@laptopd505.fenrus.org>

On 9/15/06, Arjan van de Ven <arjan@infradead.org> wrote:
> On Thu, 2006-09-14 at 15:11 -0400, Dmitry Torokhov wrote:
> > On 9/14/06, Arjan van de Ven <arjan@infradead.org> wrote:
> > >
> > > >
> > > > I think it is - as far as I understand the reason for not tracking
> > > > every lock individually is just that it is too expensive to do by
> > > > default.
> > >
> > > that is not correct. While it certainly plays a role,
> > > the other reason is that you can find out "class" level locking rules
> > > (such as inode->i_mutex comes before <other lock>) for all inodes at a
> > > time; eg no need to see every inode do this before you can find the
> > > deadlock.
> > >
> >
> > OK, I can see that. However you must agree that for certain locks we
> > do want to track them individually, right?
>
> I agree that if locks really represent different objects with different
> locking semantics they should not share the class. Lockdep provides a
> mechanism for that; however I'm very afraid that for the input layer,
> they really are not that, they are not different objects with different
> semantics; they are the same objects with nesting semantics! In that
> case the "separate lock class" stuff has only disadvantages.

I'd say they are different objects with the same semantics...

> The worst thing is that as I understand it this separate class is
> *dynamic*. Eg it's not even "one class per driver" ;(
>

You are saying this as if was a bad thing. Pass-through ports just
implement PS/2 over PS/2 protocols and as such it is very natural that
the same driver that serves parent serves the child as well. That was
the goal - to reuse psmouse module instead of re-implementing all
re-probing and protocol decoding in synaptics driver. And trackpint
driver. And maybe somethng else down the road.

I also wonder that even if we had several drivers lockdep would still
complain about nestiness just because all PS/2 devices are initialized
via ps2_init (which initializes command mutex) and end up in the same
lock class.

I suspect that other driver implementing X-over-X or X-over-Y-over-X
may get hit the same way by lockdep.

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.

-- 
Dmitry

  reply	other threads:[~2006-09-15 13:20 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 [this message]
2006-09-15 13:38                               ` Jiri Kosina
2006-09-15 13:51                                 ` Dmitry Torokhov
2006-09-15 13:56                                   ` Dmitry Torokhov
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=d120d5000609150620p15b17debo9ace17836d788958@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®