mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Valdis.Kletnieks@vt.edu
Cc: Andrew Morton <akpm@osdl.org>,
	"Barry K. Nathan" <barryn@pobox.com>,
	arjan@linux.intel.com, linux-kernel@vger.kernel.org,
	reiserfs-dev@namesys.com
Subject: Re: 2.6.17-rc5-mm3: bad unlock ordering (reiser4?)
Date: Sun, 4 Jun 2006 23:34:32 +0200	[thread overview]
Message-ID: <20060604213432.GB5898@elte.hu> (raw)
In-Reply-To: <200606042056.k54KuoKQ005588@turing-police.cc.vt.edu>


* Valdis.Kletnieks@vt.edu <Valdis.Kletnieks@vt.edu> wrote:

> On Sun, 04 Jun 2006 13:33:26 PDT, Andrew Morton said:
> 
> > Why does the locking validator complain about unlocking ordering?
> 
> Presumably, if the lock nesting *should* be "take A, take B, release 
> B, release A", if it sees "Take A, Take B, release A" it means there's 
> potentially a missing 'release B' that got forgotten (most likely an 
> error case that does a 'return;' instead of a 'goto 
> end_of_function_cleanup' like we usually code.
> 
> Having said that, I'm not sure it qualifies as a "BUG".  Certainly 
> would qualify for a "SMELLS_FISHY" though.  But we don't have one of 
> those handy, so maybe BUG is as good as it gets (given that the person 
> who built the kernel *asked* to be nagged about locking funkyness)....

yes. This warning caught a couple of bugs, and documented a couple of 
'fishy' places. Sometimes it's code that is totally correct. I think 
it's worth the extra iteration, there arent that many non-nested 
unlocking places.

straight nested unlocking is also best for performance and scalability: 
the outmost lock should be released last, because that's what the 
waiters are most likely to be blocking/spinning upon.

nevertheless i'll turn that warning into a less scary message.

	Ingo

  reply	other threads:[~2006-06-04 21:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-04 12:04 Barry K. Nathan
2006-06-04 14:00 ` Barry K. Nathan
2006-06-04 20:33 ` Andrew Morton
2006-06-04 20:56   ` Valdis.Kletnieks
2006-06-04 21:34     ` Ingo Molnar [this message]
2006-06-04 22:03       ` Barry K. Nathan
2006-06-05  2:46         ` Hans Reiser
2006-06-05  6:54         ` Ingo Molnar
2006-06-05  7:37           ` Ingo Molnar
2006-06-05 11:22             ` Alexander Zarochentsev
2006-06-05 12:50               ` Ingo Molnar
2006-06-05 23:56                 ` Hans Reiser
2006-06-05  7:58           ` Barry K. Nathan
2006-06-05  8:12             ` Ingo Molnar
2006-06-05  9:00               ` Barry K. Nathan
2006-06-09 21:39               ` Hans Reiser
2006-06-09 21:36           ` Hans Reiser

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=20060604213432.GB5898@elte.hu \
    --to=mingo@elte.hu \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=akpm@osdl.org \
    --cc=arjan@linux.intel.com \
    --cc=barryn@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reiserfs-dev@namesys.com \
    /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®