Re: [PATCH 10/43] stop_machine: reimplement without using workqueue

From: Oleg Nesterov
Date: Sun Feb 28 2010 - 09:36:34 EST


On 02/26, Tejun Heo wrote:
>
> @@ -164,19 +259,18 @@ int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus)
> idle.fn = chill;
> idle.data = NULL;
>
> + smp_wmb(); /* -> stop_cpu()::set_current_state() */
> ...
> + for_each_online_cpu(i)
> + wake_up_process(*per_cpu_ptr(stop_machine_threads, i));

Afaics, this smp_wmb() is not needed, wake_up_process() (try_to_wake_up)
should ensure we can't race with set_current_state() + check_condition.
It does, note the wmb() in try_to_wake_up().

Oleg.

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