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] [day] [month] [year] [list]
Date:	Sat, 8 Aug 2009 11:19:02 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Ming Lei <tom.leiming@...il.com>
cc:	Peter Zijlstra <peterz@...radead.org>,
	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 Sat, 8 Aug 2009, Ming Lei wrote:

> > 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.
> >
> 
> It seems that the following case is very common, and A and B have no
> common ancestor, but we can hold device A and B's lock at the same
> time, can't we?
> 
> Thanks.
> 
> device A  comes in one bus:
> 	device_add()
>          ->bus_attach_device()
>             ->device_attach():drivers/base/dd.c /*holding device A's lock*/
>                ->...drv->probe()		/*sleep here some time*/

So right now thread 1 is sleeping.

> then device B comes in another bus:

So all this must happen in a different thread, thread 2:

> 	device_add()
>          ->bus_attach_device()
>             ->device_attach():drivers/base/dd.c /*holding device B's lock*/
>                ->...drv->probe()		/*sleep here some time*/

At this point, thread 1 holds A's lock and thread 2 holds B's lock.  
Neither thread holds both locks.

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