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

From: Rafael J. Wysocki
Date: Mon Apr 02 2007 - 18:09:36 EST


On Monday, 2 April 2007 13:27, Ingo Molnar wrote:
>
> * 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.

Yes, something like this would be necessary to handle TASK_UNINTERRUPTIBLE
tasks. _Still_, currently we just fail the freezing if there are
uninterruptible tasks, because they can hold locks and may potentially
deadlock with device drivers' .suspend() or .resume() routines (please remember
that the freezer is used for suspending in the first place :-)).

I think we can freeze uninterruptible tasks for the CPU hotplug, but we should
avoid freezing them for the suspend.

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

We can catch them while we're freezing kernel threads (provided that the kernel
threads themselves aren't forking like mad, but this doesn't seem to happen in
practice).

Greetings,
Rafael
-
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/