]> git.karo-electronics.de Git - karo-tx-linux.git/commit
freezer: use dedicated lock instead of task_lock() + memory barrier
authorTejun Heo <tj@kernel.org>
Mon, 31 Oct 2011 22:30:30 +0000 (15:30 -0700)
committerTejun Heo <tj@kernel.org>
Mon, 31 Oct 2011 22:30:30 +0000 (15:30 -0700)
commit5272c4231e2e6f10d48d454bda8923dfe170c10a
treee8f90f0f1d519f755393ae681cb32722e2a4c35c
parente5f9c93d5ceadd86ab16520d3faadb3c4a032a8f
freezer: use dedicated lock instead of task_lock() + memory barrier

Freezer synchronization is needlessly complicated - it's by no means a
hot path and the priority is staying unintrusive and safe.  This patch
makes it simply use a dedicated lock instead of piggy-backing on
task_lock() and playing with memory barriers.

On the failure path of try_to_freeze_tasks(), locking is moved from it
to cancel_freezing().  This makes the frozen() test racy but the race
here is a non-issue as the warning is printed for tasks which failed
to enter frozen for 20 seconds and race on PF_FROZEN at the last
moment doesn't change anything.

This simplifies freezer implementation and eases further changes
including some race fixes.

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