lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.0908071154530.3063-100000@iolanthe.rowland.org>
Date:	Fri, 7 Aug 2009 12:04:03 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Peter Zijlstra <peterz@...radead.org>
cc:	Clark Williams <williams@...hat.com>,
	LKML <linux-kernel@...r.kernel.org>,
	RT <linux-rt-users@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	"greg@...ah.com" <greg@...ah.com>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	Kay Sievers <kay.sievers@...y.org>
Subject: Re: [RT] Lockdep warning on boot with 2.6.31-rc5-rt1.1

On Fri, 7 Aug 2009, Peter Zijlstra wrote:

> On Fri, 2009-08-07 at 09:46 -0500, Clark Williams wrote:
> > Peter,
> > 
> > I'm getting this warning from lockdep when booting on my T60. 
> > 
> > The two addresses reported (0xffffffff812664a2 and 0xffffffff812664ae)
> > actually bracket one call to mutex_lock() in driver_attach() so I'm not
> > sure what the complaint is.

> Oh, that's tglx who's gone wild with sem->mutex conversions.

Is this code available somewhere?

> It used to be that _all_ dev->sem instances were taken on suspend or
> something like that, I think that got fixed a long while back.
> 
> I'd have to look at what the current locking requirements for dev->sem
> are. 

It is supposed to be locked whenever the driver core invokes a probe, 
remove, or PM-related callback.  Under some circumstances, the parent's 
semaphore is supposed to be locked as well.  Individual subsystems may 
have their own requirements in addition to these.

The ordering requirement is: Don't try to acquire a device's lock if
you already hold the lock for a non-ancestor device.  More generally
(if more obscurely): If you already hold device A's lock, then don't
try to acquire the lock for device B unless you already hold the lock
for A & B's most recent common ancestor.

> I remember talking to Alan on several occasions about this, and I just
> went over some of the old emails, but I must say the precise
> requirements stay hidden from me. Also, I'm not sure these emails are
> still representative of the current state.

I think they are, pretty much.  The real problem, of course, is that 
lockdep doesn't understand tree-structured lock orderings.  Hence it 
isn't practical to convert dev->sem into a mutex.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ