[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070402124200.GA9566@in.ibm.com>
Date: Mon, 2 Apr 2007 18:12:00 +0530
From: Srivatsa Vaddagiri <vatsa@...ibm.com>
To: Ingo Molnar <mingo@...e.hu>
Cc: Gautham R Shenoy <ego@...ibm.com>, akpm@...ux-foundation.org,
paulmck@...ibm.com, torvalds@...ux-foundation.org,
linux-kernel@...r.kernel.org, Oleg Nesterov <oleg@...sign.ru>,
"Rafael J. Wysocki" <rjw@...k.pl>, dipankar@...ibm.com,
dino@...ibm.com, masami.hiramatsu.pt@...achi.com
Subject: Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2)
On Mon, Apr 02, 2007 at 01:18:28PM +0200, Ingo Molnar wrote:
> > if (freezing(current))
> > freeze_process(p); /* function exported by freezer */
>
> yeah. (is that safe with tasklist_lock held?)
from my scan of the code, it appears to be safe ..
> i'm wondering whether we could do even better than the signal approach.
> I _think_ the best approach would be to only wait for tasks that are _on
> the runqueue_. I.e. any task that has scheduled away with
> TASK_UNINTERRUPTIBLE (and might not be able to process signal events for
> a long time) is still freezable because it scheduled away.
I am slightly uncomfortable with "not waiting for tasks inside the
kernel to get out" part, even if it that is done only for
TASK_UNINTERRUPTIBLE tasks. For ex: consider this:
flush_workqueue() <- One of biggest offenders of lock_cpu_hotplug() to date
for_each_online_cpu(cpu)
flush_cpu_workqueue
TASK_UNINTERRUPTIBLE sleep
If we don't wait for this thread from being frozen "voluntarily" (because it is
in TASK_UNINTERRUPTIBLE sleep), then flush_workqueue is clearly racy wrt
cpu hotplug.
I would imagine other situations like this are possible where "not waiting
for everyone to /voluntarily/ quiece" can break cpu hotplug. In fact,
the biggest reason why we are moving to freezer based hotplug is the
fact that it quiesces everyone, leading to (hopefully) zero race conditions.
--
Regards,
vatsa
-
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