acrn-kernel/kernel/cgroup
Tim Van Patten 4c00f01832 cgroup_freezer: cgroup_freezing: Check if not frozen
commit cff5f49d433fcd0063c8be7dd08fa5bf190c6c37 upstream.

__thaw_task() was recently updated to warn if the task being thawed was
part of a freezer cgroup that is still currently freezing:

	void __thaw_task(struct task_struct *p)
	{
	...
		if (WARN_ON_ONCE(freezing(p)))
			goto unlock;

This has exposed a bug in cgroup1 freezing where when CGROUP_FROZEN is
asserted, the CGROUP_FREEZING bits are not also cleared at the same
time. Meaning, when a cgroup is marked FROZEN it continues to be marked
FREEZING as well. This causes the WARNING to trigger, because
cgroup_freezing() thinks the cgroup is still freezing.

There are two ways to fix this:

1. Whenever FROZEN is set, clear FREEZING for the cgroup and all
children cgroups.
2. Update cgroup_freezing() to also verify that FROZEN is not set.

This patch implements option (2), since it's smaller and more
straightforward.

Signed-off-by: Tim Van Patten <timvp@google.com>
Tested-by: Mark Hasemeyer <markhas@chromium.org>
Fixes: f5d39b0208 ("freezer,sched: Rewrite core freezer logic")
Cc: stable@vger.kernel.org # v6.1+
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-13 18:39:19 +01:00
..
Makefile
cgroup-internal.h
cgroup-v1.c cgroup: Remove duplicates in cgroup v1 tasks file 2023-10-19 23:08:57 +02:00
cgroup.c sched/cpuset: Keep track of SCHED_DEADLINE task in cpusets 2023-08-30 16:11:10 +02:00
cpuset.c cgroup/cpuset: Inherit parent's load balance state in v2 2023-09-13 09:42:49 +02:00
debug.c
freezer.c
legacy_freezer.c cgroup_freezer: cgroup_freezing: Check if not frozen 2023-12-13 18:39:19 +01:00
misc.c
namespace.c cgroup:namespace: Remove unused cgroup_namespaces_init() 2023-09-13 09:42:56 +02:00
pids.c
rdma.c
rstat.c