freezer: remove racy clear_freeze_flag() and set PF_NOFREEZE on dead tasks

clear_freeze_flag() in exit_mm() is racy.  Freezing can start
afterwards.  Remove it.  Skipping freezer for exiting task will be
properly implemented later.

Also, freezable() was testing exit_state directly to make system
freezer ignore dead tasks.  Let the exiting task set PF_NOFREEZE after
entering TASK_DEAD instead.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
This commit is contained in:
Tejun Heo
2011-11-21 12:32:23 -08:00
parent a5be2d0d1a
commit a585042f7b
2 changed files with 2 additions and 4 deletions

View File

@@ -25,8 +25,7 @@
static inline int freezable(struct task_struct * p)
{
if ((p == current) ||
(p->flags & PF_NOFREEZE) ||
(p->exit_state != 0))
(p->flags & PF_NOFREEZE))
return 0;
return 1;
}