All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Jiri Kosina <jikos@jikos.cz>, lkml <linux-kernel@vger.kernel.org>,
	Arjan van de Ven <arjan@infradead.org>
Subject: Re: [PATCH 0/3] Synaptics - fix lockdep warnings
Date: Thu, 14 Sep 2006 21:56:41 +0200	[thread overview]
Message-ID: <20060914195641.GA5812@elte.hu> (raw)
In-Reply-To: <d120d5000609141156h5e06eb68k87a6fe072a701dab@mail.gmail.com>


* Dmitry Torokhov <dmitry.torokhov@gmail.com> 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 at all the reason! The reason is that we want to find 
deadlocks _as early as mathematically possible_ (in a running system, 
where locking patterns are observed). That is we want to gather the 
_most generic_ locking rules.

For example, if there are lock_1A, lock_1B of the same lock class, and 
lock_2A and lock_2B of another lock class. If we observed the following 
usage patterns:

	acquire(lock_1A);
	acquire(lock_2A);
	release(lock_2A);
	release(lock_1A);

and another piece of kernel code did:

	acquire(lock_2B);
	acquire(lock_1B);
	release(lock_1B);
	release(lock_1B);

with per-lock rules there's no problem detected, because the 4 locks are 
independent and we only observed a 1A->2A and a 2B->1B dependency.

But with per-class rule gather we'd observe the 1->2 and the 2->1 
dependency, and we'd warn that there's a deadlock.

So we want to create as broad, as generic rules as possible, to catch 
deadlocks as soon as it's _provable_ that they could occur. In that 
sense lockdep wants to have a '100% proof' of correctness: the first 
time a bad even happens we flag it.

	Ingo

      parent reply	other threads:[~2006-09-14 20:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-14  0:44 [PATCH 0/3] Synaptics - fix lockdep warnings 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
2006-09-14 19:56                       ` Ingo Molnar [this message]

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=20060914195641.GA5812@elte.hu \
    --to=mingo@elte.hu \
    --cc=arjan@infradead.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jikos@jikos.cz \
    --cc=linux-kernel@vger.kernel.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 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.