linux/tools/testing/selftests/cgroup
Waiman Long e5ae880384 cgroup/cpuset: Fix wrong check in update_parent_subparts_cpumask()
It was found that the check to see if a partition could use up all
the cpus from the parent cpuset in update_parent_subparts_cpumask()
was incorrect. As a result, it is possible to leave parent with no
effective cpu left even if there are tasks in the parent cpuset. This
can lead to system panic as reported in [1].

Fix this probem by updating the check to fail the enabling the partition
if parent's effective_cpus is a subset of the child's cpus_allowed.

Also record the error code when an error happens in update_prstate()
and add a test case where parent partition and child have the same cpu
list and parent has task. Enabling partition in the child will fail in
this case.

[1] https://www.spinics.net/lists/cgroups/msg36254.html

Fixes: f0af1bfc27 ("cgroup/cpuset: Relax constraints to partition & cpus changes")
Cc: stable@vger.kernel.org # v6.1
Reported-by: Srinivas Pandruvada <srinivas.pandruvada@intel.com>
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2023-01-31 12:14:02 -10:00
..
.gitignore kselftest/cgroup: Add cpuset v2 partition root state test 2022-09-04 10:47:28 -10:00
cgroup_util.c selftests: cgroup: fix unsigned comparison with less than zero 2022-11-18 13:55:09 -08:00
cgroup_util.h Yang Shi has improved the behaviour of khugepaged collapsing of readonly 2022-05-26 12:32:41 -07:00
config mm: memcontrol: drop dead CONFIG_MEMCG_SWAP config symbol 2022-10-03 14:03:36 -07:00
Makefile kselftest/cgroup: Add cpuset v2 partition root state test 2022-09-04 10:47:28 -10:00
memcg_protection.m selftests: memcg: adjust expected reclaim values of protected cgroups 2022-05-27 09:33:45 -07:00
test_core.c selftests: cgroup: Test open-time cgroup namespace usage for migration checks 2022-01-06 11:02:29 -10:00
test_cpu.c cgroup: Add test_cpucg_max_nested() testcase 2022-04-25 07:27:31 -10:00
test_cpuset_prs.sh cgroup/cpuset: Fix wrong check in update_parent_subparts_cpumask() 2023-01-31 12:14:02 -10:00
test_freezer.c tests/cgroup: move cg_wait_for(), cg_prepare_for_wait() 2021-05-10 10:41:11 -04:00
test_kill.c tests/cgroup: test cgroup.kill 2021-05-10 10:41:11 -04:00
test_kmem.c kselftests: cgroup: update kmem test precision tolerance 2022-12-09 18:41:16 -08:00
test_memcontrol.c selftests: cgroup: make sure reclaim target memcg is unprotected 2022-12-11 18:12:19 -08:00
test_stress.sh kseltest/cgroup: Make test_stress.sh work if run interactively 2022-05-13 09:33:21 -10:00
wait_inotify.c kselftest/cgroup: Add cpuset v2 partition root state test 2022-09-04 10:47:28 -10:00
with_stress.sh selftests: cgroup: Run test_core under interfering stress 2019-10-07 07:11:54 -07:00