Re: CPUFREQ-CPUHOTPLUG: Possible circular locking dependency

Ingo Molnar
2006-11-30T11:53:37Z

* Gautham R Shenoy <ego@in.ibm.com> wrote:

> This is what is currently being done by cpufreq:

ok!

> a) get_some_cpu_hotplug_protection() [use either some global mechanism
> or a persubsystem mutex]

this bit is wrong i think. Any reason why it's not a per-CPU (but
otherwise global) array of mutexes that controls CPU hotplug - as per my
previous mail?

that would flatten the whole locking. Only one kind of lock taken,
recursive and scalable.

Then the mechanism that changes CPU frequency should take all these
hotplug locks on all (online) CPUs, and then first stop all processing
on all CPUs, and then do the frequency change, atomically. This is with
interrupts disabled everywhere /first/, and /without any additional
locking/. That would prevent any sort of interaction from other CPUs -
they'd all be sitting still with interrupts disabled.

Ingo