Re: [PATCH 3/3] stop_machine: change cpu_stop_queue_two_works() to rely on stopper->enabled

From: Peter Zijlstra
Date: Thu Oct 08 2015 - 11:04:39 EST


On Thu, Oct 08, 2015 at 04:51:36PM +0200, Oleg Nesterov wrote:
> @@ -261,12 +276,8 @@ int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void *
> set_state(&msdata, MULTI_STOP_PREPARE);
>
> /*
> + * We do not want to migrate to inactive CPU. FIXME: move this
> + * into the caller.
> */
> if (!cpu_active(cpu1) || !cpu_active(cpu2)) {
> preempt_enable();

So we cannot move that into the caller.. because this function sleeps
with wait_for_completion().

Or rather, it would force the caller to use get_online_cpus(), which we
worked really hard to avoid.

Also, I think we still want the patch I proposed which ensures the
stopper thread is active 'early', because the load balancer pretty much
assumes that its available. And when 'online && active' the
load-balancer is fully available.

Not only the numa balancing stop_two_cpus() caller relies on it, but
also the self migration stuff does, and at CPU_ONLINE time the cpu
really is 'free' to run anything.

--
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/