All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Jarek Poplawski <jarkao2@o2.pl>, Ingo Molnar <mingo@elte.hu>,
	Linux-pm mailing list <linux-pm@lists.linux-foundation.org>,
	Kernel development list <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: Need lockdep help
Date: Tue, 04 Dec 2007 21:14:00 +0100	[thread overview]
Message-ID: <4755B508.9020806@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0712041424270.13516-100000@iolanthe.rowland.org>

Alan Stern wrote, On 12/04/2007 08:28 PM:

> On Tue, 4 Dec 2007, Jarek Poplawski wrote:

...

> But you have to consider hypothetical kernel bugs.  That's exactly what 
> lockdep is for -- to warn you about possible deadlocks that could be 
> caused by bugs.
> 
> As a simple example, if thread #1 does "lock(A); lock(B)" and thread 
> #2 does "lock(B); lock(A)" then there's a possible bug.  Lockdep should 
> warn about you, and it does -- even if those two threads can never run 
> at the same time.
> 
> If lockdep warned about deadlocks only when they actually happened, it 
> wouldn't be nearly so useful.


Sure! I probably missed your point... Lockdep always names reported locks,
so I meant 'hypothetical' only trying to explain lockdep with some other,
unknown or unnamed bugs.

So, depending on the code, above example with A & B could be a real bug
(even if very improbable but logically justified) or a false alarm (eg.
when we know both threads could never work at the same).

Jarek P.

  parent reply	other threads:[~2007-12-04 20:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-02 19:45 Need lockdep help Alan Stern
2007-12-02 20:04 ` Arjan van de Ven
2007-12-02 20:08   ` Alan Stern
2007-12-02 20:08   ` Alan Stern
2007-12-03 10:36 ` Jarek Poplawski
2007-12-03 10:36 ` Jarek Poplawski
2007-12-03 15:08   ` Alan Stern
2007-12-03 23:25     ` Jarek Poplawski
2007-12-03 23:25     ` Jarek Poplawski
2007-12-04 15:17       ` Alan Stern
2007-12-04 15:17       ` Alan Stern
2007-12-04 19:02         ` Jarek Poplawski
2007-12-04 19:02         ` Jarek Poplawski
2007-12-04 19:28           ` Alan Stern
2007-12-04 20:14             ` Jarek Poplawski
2007-12-04 20:14             ` Jarek Poplawski [this message]
2007-12-04 19:28           ` Alan Stern
2007-12-04 21:00         ` Ingo Molnar
2007-12-04 21:00         ` Ingo Molnar
2007-12-03 15:08   ` Alan Stern
  -- strict thread matches above, loose matches on Subject: below --
2007-12-02 19:45 Alan Stern

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=4755B508.9020806@gmail.com \
    --to=jarkao2@gmail.com \
    --cc=jarkao2@o2.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=stern@rowland.harvard.edu \
    /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.