]> git.karo-electronics.de Git - karo-tx-linux.git/commit
freezer: test freezable conditions while holding freezer_lock
authorTejun Heo <tj@kernel.org>
Mon, 31 Oct 2011 22:30:31 +0000 (15:30 -0700)
committerTejun Heo <tj@kernel.org>
Mon, 31 Oct 2011 22:30:31 +0000 (15:30 -0700)
commit9f23273627f9bb8cf44d4beaa92dbf271e8dbe95
tree6fea99f88c6e4a789ce3c0031de2d3842cf0deff
parent0a2769bc117e601488d2290e9a782838401a0956
freezer: test freezable conditions while holding freezer_lock

try_to_freeze_tasks() and thaw_processes() use freezable() and
frozen() as preliminary tests before initiating operations on a task.
These are done without any synchronization and hinder with
synchronization cleanup without any real performance benefits.

In try_to_freeze_tasks(), open code self test and move PF_NOFREEZE and
frozen() tests inside freezer_lock in freeze_task().

thaw_processes() can simply drop freezable() test as frozen() test in
__thaw_task() is enough.

Note: This used to be a part of larger patch to fix set_freezable()
      race.  Separated out to satisfy ordering among dependent fixes.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
kernel/freezer.c
kernel/power/process.c