Skip to content
  • Tejun Heo's avatar
    cgroup_freezer: make it official that writes to freezer.state don't fail · 51f246ed
    Tejun Heo authored
    
    
    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: default avatarTejun Heo <tj@kernel.org>
    Cc: Oleg Nesterov <oleg@redhat.com>
    Cc: Rafael J. Wysocki <rjw@sisk.pl>
    51f246ed