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  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:	Fri, 1 Dec 2006 09:55:02 +0100
From:	Ingo Molnar <>
To:	Gautham R Shenoy <>
Cc:	Andrew Morton <>,,,,,
Subject: Re: CPUFREQ-CPUHOTPLUG: Possible circular locking dependency

* Gautham R Shenoy <> wrote:

> Consider a case where we have three locks A, B and C.
> We have very clear locking rule inside the kernel that lock A *should*
> be acquired before acquiring either lock B or lock C.
> At runtime lockdep detects the two dependency chains,
> A --> B --> C
> and
> A --> C --> B.
> Does lockdep issue a circular dependency warning for this ? 
> It's quite clear from the locking rule that we cannot have a
> circular deadlock, since A acts as a mutex for B->C / C->B callpath.
> Just curious :-) [ Well, I might encounter such a scenario in an attempt
> 		   to make cpufreq cpu-hotplug safe! ]

yes, lockdep will warn about this. Will you /ever/ have a B->C or C->B 
dependency without A being taken first?

if not then my suggestion would be to just lump 'B' and 'C' into a 
single lock - or to get rid of them altogether. There's little reason to 
keep them separate. /If/ you want to keep them separate (because they 
protect different data structures) then it's the cleanest design to have 
an ordering between them. The taking of 'A' might go away anytime - such 
a construct is really, really fragile and is only asking for trouble.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists