[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141210001239.GA516@redhat.com>
Date: Wed, 10 Dec 2014 01:12:39 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: David Hildenbrand <dahi@...ux.vnet.ibm.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 v3] CPU hotplug: active_writer not woken up in some
cases - deadlock
(sorry if this was already discussed, I ignored most of my emails
I got this week)
On 12/09, David Hildenbrand wrote:
>
> @@ -116,7 +118,13 @@ void put_online_cpus(void)
> if (cpu_hotplug.active_writer == current)
> return;
> if (!mutex_trylock(&cpu_hotplug.lock)) {
> + /* inc before testing for active_writer to not lose wake ups */
> atomic_inc(&cpu_hotplug.puts_pending);
> + spin_lock(&cpu_hotplug.awr_lock);
> + /* we might be the last one */
> + if (unlikely(cpu_hotplug.active_writer))
> + wake_up_process(cpu_hotplug.active_writer);
> + spin_unlock(&cpu_hotplug.awr_lock);
Not sure I understand. awr_lock can only ensure that active_writer
can't go away.
Why active_writer should see .puts_pending != 0 if this is called
right after cpu_hotplug_begin() takes cpu_hotplug.lock but before
it sets TASK_UNINTERRUPTIBLE?
IOW,
> void cpu_hotplug_begin(void)
> {
> + spin_lock(&cpu_hotplug.awr_lock);
> cpu_hotplug.active_writer = current;
> + spin_unlock(&cpu_hotplug.awr_lock);
>
> cpuhp_lock_acquire();
> for (;;) {
> mutex_lock(&cpu_hotplug.lock);
> + __set_current_state(TASK_UNINTERRUPTIBLE);
don't we need set_current_state() here ?
Oleg.
--
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