Re: [PATCH 2/3] cpu: add a CPU_DOWN_PREPARE notifier

From: Nick Piggin
Date: Thu Sep 09 2004 - 06:18:16 EST


Nick Piggin wrote:
Rusty Russell wrote:

On Wed, 2004-09-08 at 22:52, Nick Piggin wrote:

2/3

Rusty, can I do this?

______________________________________________________________________
Add a CPU_DOWN_PREPARE hotplug CPU notifier. This is needed so we can
dettach all sched-domains before a CPU goes down, thus we can build
domains from online cpumasks, and not have to check for the possibility
of a CPU coming up or going down.



And if taking the CPU down fails? If you need this, you need the
CPU_DOWN_FAILED as well, unfortunately. Hence I prefer the "do the
domain thing while machine is frozen" and sidestep it entirely.


Really? It doesn't need to be run from the stop_machine_run
context at all - it can happily be done while the system is
running.

That said, if you really object to CPU_DOWN_PREPARE and CPU_DOWN_FAILED,
it probably shouldn't be too much work. Should it make the call from
take_cpu_down?


The other thing is, it is actually a lot nicer to have this done while
the machine is running, because then cpu_attach_domain guarantees a
quiescent state, so the attach can be done completely atomically from
the point of view of the rest of the scheduler.

So you can always rely on domains and cpu_online_map staying in synch.
The alternative is more fastpath checking of the cpu_online_map, and
possibly more hotplug locks.

In short, I'd really like to have it done this way.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/