Re: [PATCH v5] CPU hotplug: active_writer not woken up in some cases - deadlock

Oleg Nesterov
2014-12-14T19:30:36Z

On 12/12, David Hildenbrand wrote:
>
> void get_online_cpus(void)
> {
> @@ -103,8 +95,7 @@ void get_online_cpus(void)
> return;
> cpuhp_lock_acquire_read();
> mutex_lock(&cpu_hotplug.lock);
> - apply_puts_pending(65536);
> - cpu_hotplug.refcount++;
> + atomic_inc(&cpu_hotplug.refcount);
> mutex_unlock(&cpu_hotplug.lock);

I think the patch is fine.

I am wondering if it makes sense to add

if (atomic_inc_not_zero(&cpu_hotplug.refcount))
return;

before mutex_lock(). But even if I am right we can do this later.

Oleg.