kernel_optimize_test/kernel/power
Tejun Heo 6907483b4e 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.

With the change, frozen() state my linger after __thaw_task() until
the task wakes up and exits fridge.  This can trigger BUG_ON() in
update_if_frozen().  Work it around by testing freezing() && frozen()
instead of frozen().

-v2: Oleg pointed out missing re-check of freezing() when trying to
     clear FROZEN and possible spurious BUG_ON() trigger in
     update_if_frozen().  Both fixed.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Paul Menage <paul@paulmenage.org>
2011-11-21 12:32:24 -08:00
..
block_io.c
console.c PM / VT: Cleanup #if defined uglyness and fix compile error 2011-10-16 23:28:51 +02:00
hibernate.c PM / Hibernate: Fix the early termination of test modes 2011-11-18 23:02:42 +01:00
Kconfig Merge branch 'devel-stable' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm 2011-10-28 12:02:27 -07:00
main.c PM / Suspend: Fix bug in suspend statistics update 2011-11-19 14:37:57 +01:00
Makefile PM / VT: Cleanup #if defined uglyness and fix compile error 2011-10-16 23:28:51 +02:00
power.h PM / Hibernate: Improve performance of LZO/plain hibernation, checksum image 2011-10-16 23:30:38 +02:00
poweroff.c
process.c freezer: make freezing indicate freeze condition in effect 2011-11-21 12:32:24 -08:00
qos.c PM / QoS: Set cpu_dma_pm_qos->name 2011-11-07 23:02:24 +01:00
snapshot.c PM / Hibernate: Include storage keys in hibernation image on s390 2011-10-16 23:27:46 +02:00
suspend_test.c
suspend.c kernel: Fix files explicitly needing EXPORT_SYMBOL infrastructure 2011-10-31 19:30:05 -04:00
swap.c PM / Hibernate: Improve performance of LZO/plain hibernation, checksum image 2011-10-16 23:30:38 +02:00
user.c kernel: fix several implicit usasges of kmod.h 2011-10-31 09:20:12 -04:00