Re: [RFC][PATCH 12/13] stop_machine: Remove lglock
From: Peter Zijlstra
Date: Thu Jun 25 2015 - 15:18:21 EST
On Tue, Jun 23, 2015 at 07:24:16PM +0200, Oleg Nesterov wrote:
> IOW. Suppose we add ->work_mutex into struct cpu_stopper. Btw,
> I think we should move all per-cpu variables there...
>
> Now,
>
> lock_stop_cpus_works(cpumask)
> {
> for_each_cpu(cpu, cpumask)
> mutex_lock(per_cpu(cpu_stopper_task, cpu).work_mutex);
> }
>
> unlock_stop_cpus_works(cpumask)
> {
> for_each_cpu(cpu, cpumask)
> mutex_lock(...);
> }
>
> which should be used instead of stop_cpus_mutex. After this change
> stop_two_cpus() can just use stop_cpus().
Right, lockdep annotating that will be 'interesting' though. And
stop_two_cpus() then has the problem of allocating a cpumask. Simpler to
let it keep 'abuse' the queueing spinlock in there.
> Off-topic. Can't we make __stop_machine() static? The only caller,
> _cpu_down() can safely call stop_machine(), get_online_cpus() is
> fine under cpu_hotplug_begin().
Can do I think.
--
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/