linux/kernel/power
Tejun Heo 22b4e111fa cgroup_freezer: prepare for removal of TIF_FREEZE
TIF_FREEZE will be removed soon and freezing() will directly test
whether any freezing condition is in effect.  Make the following
changes in preparation.

* Rename cgroup_freezing_or_frozen() to cgroup_freezing() and make it
  return bool.

* Make cgroup_freezing() access task_freezer() under rcu read lock
  instead of task_lock().  This makes the state dereferencing racy
  against task moving to another cgroup; however, it was already racy
  without this change as ->state dereference wasn't synchronized.
  This will be later dealt with using attach hooks.

* freezer->state is now set before trying to push tasks into the
  target state.

-v2: Oleg pointed out that freeze_change_state() was setting
     freeze->state incorrectly to CGROUP_FROZEN instead of
     CGROUP_FREEZING.  Fixed.

-v3: Matt pointed out that setting CGROUP_FROZEN used to always invoke
     try_to_freeze_cgroup() regardless of the current state.  Patch
     updated such that the actual freeze/thaw operations are always
     performed on invocation.  This shouldn't make any difference
     unless something is broken.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Paul Menage <paul@paulmenage.org>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Oleg Nesterov <oleg@redhat.com>
2011-11-21 12:32:25 -08: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
Makefile PM / VT: Cleanup #if defined uglyness and fix compile error 2011-10-16 23:28:51 +02:00
block_io.c block: kill off REQ_UNPLUG 2011-03-10 08:52:27 +01:00
console.c PM / VT: Cleanup #if defined uglyness and fix compile error 2011-10-16 23:28:51 +02:00
hibernate.c freezer: clean up freeze_processes() failure path 2011-11-21 12:32:24 -08:00
main.c PM / Suspend: Fix bug in suspend statistics update 2011-11-19 14:37:57 +01:00
power.h PM / Hibernate: Improve performance of LZO/plain hibernation, checksum image 2011-10-16 23:30:38 +02:00
poweroff.c Input: sysrq - drop tty argument from sysrq ops handlers 2010-08-19 22:07:06 -07:00
process.c cgroup_freezer: prepare for removal of TIF_FREEZE 2011-11-21 12:32:25 -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.c freezer: clean up freeze_processes() failure path 2011-11-21 12:32:24 -08:00
suspend_test.c PM: Make warning in suspend_test_finish() less likely to happen 2009-10-22 08:23:45 +09:00
swap.c PM / Hibernate: Improve performance of LZO/plain hibernation, checksum image 2011-10-16 23:30:38 +02:00
user.c freezer: clean up freeze_processes() failure path 2011-11-21 12:32:24 -08:00