cgroup/cpuset: Make partition invalid if cpumask change violates exclusivity rule
authorWaiman Long <longman@redhat.com>
Thu, 1 Sep 2022 20:57:43 +0000 (16:57 -0400)
committerTejun Heo <tj@kernel.org>
Sun, 4 Sep 2022 20:47:28 +0000 (10:47 -1000)
commitd7c8142d5a5534c3c7de214e35a40a493a32b98e
treeba224feb7b4e830acec45abc8689cd72987a163a
parent74027a6535fdabef69c57234359d9fbdb4597398
cgroup/cpuset: Make partition invalid if cpumask change violates exclusivity rule

Currently, changes in "cpust.cpus" of a partition root is not allowed if
it violates the sibling cpu exclusivity rule when the check is done
in the validate_change() function. That is inconsistent with the
other cpuset changes that are always allowed but may make a partition
invalid.

Update the cpuset code to allow cpumask change even if it violates the
sibling cpu exclusivity rule, but invalidate the partition instead
just like the other changes. However, other sibling partitions with
conflicting cpumask will also be invalidated in order to not violating
the exclusivity rule. This behavior is specific to this partition
rule violation.

Note that a previous commit has made sibling cpu exclusivity rule check
the last check of validate_change(). So if -EINVAL is returned, we can
be sure that sibling cpu exclusivity rule violation is the only rule
that is broken.

Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cpuset.c