[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141211105647.4e3a25d8@thinkpad-w530>
Date: Thu, 11 Dec 2014 10:56:47 +0100
From: David Hildenbrand <dahi@...ux.vnet.ibm.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: linux-kernel@...r.kernel.org, heiko.carstens@...ibm.com,
borntraeger@...ibm.com, rafael.j.wysocki@...el.com,
paulmck@...ux.vnet.ibm.com, peterz@...radead.org, bp@...e.de,
jkosina@...e.cz
Subject: Re: [PATCH v4] CPU hotplug: active_writer not woken up in some
cases - deadlock
> This is subjective, but how about
>
> static bool xxx(void)
> {
> mutex_lock(&cpu_hotplug.lock);
> if (atomic_read(&cpu_hotplug.refcount) == 0)
> return true;
> mutex_unlock(&cpu_hotplug.lock);
> return false;
> }
>
> void cpu_hotplug_begin(void)
> {
> cpu_hotplug.active_writer = current;
>
> cpuhp_lock_acquire();
> wait_event(&cpu_hotplug.wq, xxx());
> }
>
> instead?
>
> Oleg.
>
Just checked wait_event(). It is safe against such race conditions as the same
pattern is used is applied internally.
Thanks!
David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists