Re: [RFC] Cpu-hotplug: Using the Process Freezer (try2)

From: Ingo Molnar
Date: Mon Apr 02 2007 - 07:28:57 EST



* Gautham R Shenoy <ego@xxxxxxxxxx> wrote:

> From what I can make out, we fail to freeze if we have some task in
> the TASK_UNINTERRUPTIBLE state for more than the timeout period.

> Question is can we have some task in TASK_UNINTERRUPTIBLE state for
> such a long duration (20sec) ??

yes, easily so - just have a really long disk queue. Or really heavy
mutex contention.

i really think we should add a freezing hook to schedule too (no need to
change anything else - just add a PF_FREEZE check into the schedule()
function) - and add a wakeup method that moves TASK_UNINTERRUPTIBLE
tasks to the runqueue but does not touch their task->state.

( the copy_process() handling is still needed, so that no new tasks
without PF_FREEZE get created that could slip out of control. )

Such a wakeup will cause them to execute again but without disturbing
their task->state value, at which point a second hook in schedule()
could catch and freeze them. (and can restart the sleep afterwards, if
the task is still TASK_UNINTERRUPTIBLE)

i.e. two easy hooks in schedule() plus a try_to_wake_up() variant that
does not touch p->state. In fact the second hook could be used instead
of the first one so one might be enough. (I can code up the scheduler
bits for you if that would be helpful.)

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