]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/commit
cgroup_freezer: make it official that writes to freezer.state don't fail
authorTejun Heo <tj@kernel.org>
Tue, 16 Oct 2012 22:03:14 +0000 (15:03 -0700)
committerTejun Heo <tj@kernel.org>
Tue, 16 Oct 2012 22:03:14 +0000 (15:03 -0700)
commit51f246ed95caed12898649d8170d2d352da6af76
tree28215338713b2aa79414e00adfb096ba7163248d
parentdd67d32dbc5de299d70cc9e10c6c1e29ffa56b92
cgroup_freezer: make it official that writes to freezer.state don't fail

try_to_freeze_cgroup() has condition checks which are intended to fail
the write operation to freezer.state if there are tasks which can't be
frozen.  The condition checks have been broken for quite some time
now.  freeze_task() returns %false if the target task can't be frozen,
so num_cant_freeze_now is never incremented.

In addition, strangely, cgroup freezing proceeds even after the write
is failed, which is rather broken.

This patch rips out the non-working code intended to fail the write to
freezer.state when the cgroup contains non-freezable tasks and makes
it official that writes to freezer.state succeed whether there are
non-freezable tasks in the cgroup or not.

This leaves is_task_frozen_enough() with only one user -
upste_if_frozen().  Collapse it into the caller.  Note that this
removes an extra call to freezing().

This doesn't cause any userland behavior changes.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
kernel/cgroup_freezer.c