linux-kernel-test/kernel/power
Rafael J. Wysocki 33e1c288da freezer: close potential race between refrigerator and thaw_tasks
If the freezing of tasks fails and a task is preempted in refrigerator()
before calling frozen_process(), then thaw_tasks() may run before this task is
frozen.  In that case the task will freeze and no one will thaw it.

To fix this race we can call freezing(current) in refrigerator() along with
frozen_process(current) under the task_lock() which also should be taken in
the error path of try_to_freeze_tasks() as well as in thaw_process().
Moreover, if thaw_process() additionally clears TIF_FREEZE for tasks that are
not frozen, we can be sure that all tasks are thawed and there are no pending
"freeze" requests after thaw_tasks() has run.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-23 20:14:10 -07:00
..
console.c [PATCH] swsusp: fix suspend when console is in VT_AUTO+KD_GRAPHICS mode 2007-03-16 19:25:05 -07:00
disk.c swsusp: fix sysfs interface 2007-05-17 05:23:05 -07:00
Kconfig Merge branch 'linux-2.6' 2007-05-08 13:37:51 +10:00
main.c swsusp: fix sysfs interface 2007-05-17 05:23:05 -07:00
Makefile [PATCH] Disable CPU hotplug during suspend 2006-09-26 08:48:59 -07:00
pm.c [PATCH] remove kernel/power/pm.c:pm_unregister_all() 2006-07-12 16:09:08 -07:00
power.h PM: Separate hibernation code from suspend code 2007-05-09 12:30:48 -07:00
poweroff.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
process.c freezer: close potential race between refrigerator and thaw_tasks 2007-05-23 20:14:10 -07:00
snapshot.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2007-05-09 12:56:01 -07:00
swap.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
swsusp.c swsusp: free more memory 2007-05-07 12:12:59 -07:00
user.c PM: Separate hibernation code from suspend code 2007-05-09 12:30:48 -07:00