]> 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>
Sat, 20 Aug 2011 09:31:39 +0000 (11:31 +0200)
committerTejun Heo <tj@kernel.org>
Sat, 20 Aug 2011 09:31:39 +0000 (11:31 +0200)
commit005262e6a0fe25f6a65061a45a725a20d4806d87
tree87996456b16e585ee90ba3412f43623213ea8b12
parentdb984b394ab5bd2606e117211a58f04dd635df9b
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