cgroup/cpuset: Enable invalid to valid local partition transition
authorWaiman Long <longman@redhat.com>
Tue, 3 Oct 2023 14:44:20 +0000 (10:44 -0400)
committerTejun Heo <tj@kernel.org>
Wed, 4 Oct 2023 18:54:40 +0000 (08:54 -1000)
commit46c521bac592251229acdd2cd67976a7b1f88bed
treec28dd88308b50c0ee35ca737de4aff9976bfb308
parent9b81d3a5be05d350ac93d99762c7ee91fe29b4cb
cgroup/cpuset: Enable invalid to valid local partition transition

When a local partition becomes invalid, it won't transition back to
valid partition automatically if a proper "cpuset.cpus.exclusive" or
"cpuset.cpus" change is made. Instead, system administrators have to
explicitly echo "root" or "isolated" into the "cpuset.cpus.partition"
file at the partition root.

This patch now enables the automatic transition of an invalid local
partition back to valid when there is a proper "cpuset.cpus.exclusive"
or "cpuset.cpus" change.

Automatic transition of an invalid remote partition to a valid one,
however, is not covered by this patch. They still need an explicit
write to "cpuset.cpus.partition" to become valid again.

The test_cpuset_prs.sh test script is updated to add new test cases to
test this automatic state transition.

Reported-by: Pierre Gondois <pierre.gondois@arm.com>
Link: https://lore.kernel.org/lkml/9777f0d2-2fdf-41cb-bd01-19c52939ef42@arm.com
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cpuset.c
tools/testing/selftests/cgroup/test_cpuset_prs.sh