Re: [RFC] Fix SMP brokenness for PF_FREEZE and make freezing usable for other purposes

From: Pavel Machek
Date: Mon Jun 27 2005 - 10:13:11 EST


Hi!

> > It's called "work", and we have the "TIF_xxx" flags for it. That's how
> > "need-resched" and "sigpending" are done. There could be a
> > "TIF_FREEZEPENDING" thing there too..
>
> Ok. Here is yet another version of the patch:
>
> ---
> The current suspend code modifies thread flags from outside the context of process.
> This creates a SMP race.
>
> The patch fixes that by introducing a TIF_FREEZE flag (for all arches). Also
>
> - Uses a completion handler instead of waiting in a schedule loop in the refrigerator.
>
> - Introduces a semaphore freezer_sem to provide a way that multiple kernel
> subsystems can use the freezing ability without interfering with one another.
>
> - Include necessary definitions for the migration code if CONFIG_MIGRATE is set.
>
> - Removes PF_FREEZE
>
> If this approach is okay then we will need to move the refrigerator() and the
> definition of the semaphore and the completion variable out of kernel/power/process.c
> into kernel/sched.c (right?).

Approach seems okay... Perhaps better place is something like
kernel/freezer.c so it stays separate file? It is not really scheduler
core, and it is only conditionally compiled...
Pavel
--
Boycott Kodak -- for their patent abuse against Java.
-
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/