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

From: Oleg Nesterov
Date: Sun Dec 14 2014 - 14:30:41 EST


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.

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