Skip to content

Commit 9ace34a

Browse files
committed
Merge tag 'cgroup-for-6.7-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup fix from Tejun Heo: "Just one fix. Commit f5d39b0 ("freezer,sched: Rewrite core freezer logic") changed how freezing state is recorded which made cgroup_freezing() disagree with the actual state of the task while thawing triggering a warning. Fix it by updating cgroup_freezing()" * tag 'cgroup-for-6.7-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup_freezer: cgroup_freezing: Check if not frozen
2 parents e0348c1 + cff5f49 commit 9ace34a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

kernel/cgroup/legacy_freezer.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,15 @@ static struct freezer *parent_freezer(struct freezer *freezer)
6666
bool cgroup_freezing(struct task_struct *task)
6767
{
6868
bool ret;
69+
unsigned int state;
6970

7071
rcu_read_lock();
71-
ret = task_freezer(task)->state & CGROUP_FREEZING;
72+
/* Check if the cgroup is still FREEZING, but not FROZEN. The extra
73+
* !FROZEN check is required, because the FREEZING bit is not cleared
74+
* when the state FROZEN is reached.
75+
*/
76+
state = task_freezer(task)->state;
77+
ret = (state & CGROUP_FREEZING) && !(state & CGROUP_FROZEN);
7278
rcu_read_unlock();
7379

7480
return ret;

0 commit comments

Comments
 (0)