]> git.karo-electronics.de Git - karo-tx-linux.git/commit
freezer: make freezing indicate freeze condition in effect
authorTejun Heo <tj@kernel.org>
Sat, 20 Aug 2011 09:31:40 +0000 (11:31 +0200)
committerTejun Heo <tj@kernel.org>
Sat, 20 Aug 2011 09:31:40 +0000 (11:31 +0200)
commitc4adb5122ab674d3572b04b1cebaf2b2f46cfc26
tree3d66b156d8565acae4a8e04f058077c04259bbda
parent005262e6a0fe25f6a65061a45a725a20d4806d87
freezer: make freezing indicate freeze condition in effect

Currently freezing (TIF_FREEZE) and frozen (PF_FROZEN) states are
interlocked - freezing is set to request freeze and when the task
actually freezes, it clears freezing and sets frozen.

This interlocking makes things more complex than necessary - freezing
doesn't mean there's freezing condition in effect and frozen doesn't
match the task actually entering and leaving frozen state (it's
cleared by the thawing task).

This patch makes freezing indicate that freeze condition is in effect.
A task enters and stays frozen if freezing.  This makes PF_FROZEN
manipulation done only by the task itself and prevents wakeup from
__thaw_task() leaking outside of refrigerator.

The only place which needs to tell freezing && !frozen is
try_to_freeze_task() to whine about tasks which don't enter frozen.
It's updated to test the condition explicitly.

Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/freezer.c
kernel/power/process.c