public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dawson Engler <engler@csl.Stanford.EDU>
To: linux-kernel@vger.kernel.org
Cc: mc@cs.Stanford.EDU
Subject: [CHECKER] a couple potential deadlocks in 2.4.5-ac8
Date: Sat, 9 Jun 2001 00:59:24 -0700 (PDT)	[thread overview]
Message-ID: <200106090759.AAA15771@csl.Stanford.EDU> (raw)

Hi All,

we're starting to develop a checker that finds deadlocks by (1)
computing all lock acquisition paths and (2) checking if two paths
violate a partial order.

E.g., for two threads T1 and T2:
	T1: foo acquires A --> calls bar which tries to acquire B
	T2: baz acquires B --> calls blah which tries to acquire A
all else being equal, this deadlocks.

The checker is pretty primitive.  In particular:
	- lots of false negatives come from the fact that it does not 
	  track interrupt disabling.  A missed deadlock:
		foo acquires A
		bar interrupts foo, disables interrupts, tries to acquire A
	  (Is this the most common deadlock?)

	- many potential false positives since it does not realize when
	two kernel call traces are mutually exclusive.

To check it's mechanics I've enclosed what look to me to be two potential
deadlocks --- given the limits of the tool and my understanding of what
can happen when, these could be (likely be?) false positive, so I'd
appreciate any corrective feedback.

Dawson
--------------------------------------------------------------------
ERROR: violated partial order [lock_super:sb<--->lock_kernel:$none$]
   path for lock_super:sb -> lock_kernel:$none$

seems reasonable: all contained in the same FS.

       path for lock_super:sb -> lock_kernel:$none$
                sysv_new_inode:100:lock_super(sb) --> 145:sysv_write_inode
                        -->sysv_write_node:1183:lock_kernel

        path for lock_kernel -> lock_super:sb
                sysv_get_block:812:lock_kernel --> 855:block_getblk
                  --> block_getblk:766:sysv_free_block
                  --> sysv_free_block:45:lock_super

--------------------------------------------------------------------
ERROR: violated partial order [lock_super:sb<--->lock_kernel:$none$]
   path for lock_super:sb -> lock_kernel:$none$

[BUG] Unless lock_kernel already held, which is certainly possible...

       path for lock_super:sb -> lock_kernel:$none$
               sysv_new_inode:100:lock_super(sb);
                        --> sysv_write_inode:1134:lock_kernel();

       path for lock_kernel--> lock_super:
                fsync_dev:325:lock_kernel --> sync_supers:599:lock_super

-------------------------------------------------------------------

             reply	other threads:[~2001-06-09  7:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-09  7:59 Dawson Engler [this message]
2001-06-09  8:11 ` checker suggestion Albert D. Cahalan
2001-06-10  2:04   ` Dawson Engler
2001-06-09 10:45 ` [CHECKER] a couple potential deadlocks in 2.4.5-ac8 Alexander Viro
2001-06-09 17:32 ` Linus Torvalds
2001-06-09 17:45   ` Alexander Viro
2001-06-09 19:01     ` Linus Torvalds
2001-06-09 19:33       ` David Woodhouse
2001-06-09 20:37         ` Linus Torvalds
2001-06-10 11:53         ` Rusty Russell
2001-06-10 11:59           ` David Woodhouse
2001-06-09 19:36       ` Alexander Viro
2001-06-09 20:42         ` Linus Torvalds
2001-06-09 21:44           ` Alexander Viro
2001-06-10  2:28       ` Dawson Engler
2001-06-10  6:19         ` Linus Torvalds
2001-06-10  7:45           ` Dawson Engler

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=200106090759.AAA15771@csl.Stanford.EDU \
    --to=engler@csl.stanford.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mc@cs.Stanford.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox