[lkml]   [2006]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: CPUFREQ-CPUHOTPLUG: Possible circular locking dependency
On Thu, 30 Nov 2006 12:46:17 +0100
Ingo Molnar <> wrote:

> * Andrew Morton <> wrote:
> > > This would be done totally serialized and while holding the hotplug
> > > lock, so no CPU could go away or arrive while this operation is
> > > going on.
> >
> > You said "the hotplug lock". That is the problem.
> maybe i'm too dense today but i still dont see the fundamental problem.
> Even with complex inter-subsystem interactions, hotplugging could be
> effectively and scalably controlled via a self-recursive per-CPU mutex,
> and a pointer to it embedded in task_struct:

Yes, I suppose we could come up with now new lock type which fixes the
problem. But first, let us review the problem.

Someone went through cpufreq sprinkling lock_cpu_hotplug() everywhere as if
it had magical properties. For the past year or more, others have been
picking through the resulting bugs, trying to make things better and
treating that initial magic-pixie-dust as if it were inviolate and nobody
had a chance of understanding it.

IOW, cpufreq is screwed up, and we keep on trying to come up with more
complexity to unscrew it.

So what I would propose is that rather than going ahead and piling more
complexity on top of the existing poo-pile in an attempt to make it seem to
work, we should simply rip all the cpu-hotplug locking out of cpufreq
(there's a davej patch for that in -mm) and then just redo it all in an
organised fashion.

If, as a result of that exercise, we decide that the existing cpu-hotplug
serialisation mechanisms (ie: per-subsystem notification callbacks and
preempt_disable()) are insufficient then sure, that is the time to think
about more sophisticated locking primitives.

But please, let's stop asking "how do we make cpufreq's hotplug locking
work?". Let's instead ask "how do we make cpufreq safe wrt hotplug?"

To do the latter is a matter of

- identify the per-cpu resources which need locking

- decide what mechanism is to be used to protect each such resource

- design the locking and its hierarchy

- implement, test.

In all this time, Gautham's emails from yesterday were the first occasion
on which anybody has taken the time to sit down and get us started on this
quite ordinary design & devel process.

Let me re-re-re-re-reiterate: this is a cpufreq problem. It has not yet
been demonstrated (AFAICS) that it is a general problem. I am unaware of
any other subsystems having got themselves into such a mess over hotplug
locking. Now, maybe that's because cpufreq really is especially hard. Or
maybe it's because it's just messed up. I don't believe we know which of
those is true yet.
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

 \ /
  Last update: 2006-11-30 20:43    [W:0.054 / U:3.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site