Merge tag 'cgroup-for-6.16-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup

Pull cgroup fixes from Tejun Heo:
 "An earlier commit to suppress a warning introduced a race condition
  where tasks can escape cgroup1 freezer. Revert the commit and simply
  remove the warning which was spurious to begin with"

* tag 'cgroup-for-6.16-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
  Revert "cgroup_freezer: cgroup_freezing: Check if not frozen"
  sched,freezer: Remove unnecessary warning in __thaw_task
This commit is contained in:
Linus Torvalds
2025-07-19 10:00:47 -07:00
2 changed files with 4 additions and 19 deletions
+1 -7
View File
@@ -66,15 +66,9 @@ static struct freezer *parent_freezer(struct freezer *freezer)
bool cgroup_freezing(struct task_struct *task)
{
bool ret;
unsigned int state;
rcu_read_lock();
/* Check if the cgroup is still FREEZING, but not FROZEN. The extra
* !FROZEN check is required, because the FREEZING bit is not cleared
* when the state FROZEN is reached.
*/
state = task_freezer(task)->state;
ret = (state & CGROUP_FREEZING) && !(state & CGROUP_FROZEN);
ret = task_freezer(task)->state & CGROUP_FREEZING;
rcu_read_unlock();
return ret;
+3 -12
View File
@@ -201,18 +201,9 @@ static int __restore_freezer_state(struct task_struct *p, void *arg)
void __thaw_task(struct task_struct *p)
{
unsigned long flags;
spin_lock_irqsave(&freezer_lock, flags);
if (WARN_ON_ONCE(freezing(p)))
goto unlock;
if (!frozen(p) || task_call_func(p, __restore_freezer_state, NULL))
goto unlock;
wake_up_state(p, TASK_FROZEN);
unlock:
spin_unlock_irqrestore(&freezer_lock, flags);
guard(spinlock_irqsave)(&freezer_lock);
if (frozen(p) && !task_call_func(p, __restore_freezer_state, NULL))
wake_up_state(p, TASK_FROZEN);
}
/**