cgroup/cpuset: Don't allow creation of local partition over a remote one
authorWaiman Long <longman@redhat.com>
Sun, 30 Mar 2025 21:52:43 +0000 (17:52 -0400)
committerTejun Heo <tj@kernel.org>
Mon, 31 Mar 2025 23:26:53 +0000 (13:26 -1000)
commit6da580ec656a5ed135db2cdf574b47635611a4d7
tree561d7800c7b1bbdb9ced561b5dd7fbae22b36093
parentf62a5d39368e34a966c8df63e1f05eed7fe9c5de
cgroup/cpuset: Don't allow creation of local partition over a remote one

Currently, we don't allow the creation of a remote partition underneath
another local or remote partition. However, it is currently possible to
create a new local partition with an existing remote partition underneath
it if top_cpuset is the parent. However, the current cpuset code does
not set the effective exclusive CPUs correctly to account for those
that are taken by the remote partition.

Changing the code to properly account for those remote partition CPUs
under all possible circumstances can be complex. It is much easier to
not allow such a configuration which is not that useful. So forbid
that by making sure that exclusive_cpus mask doesn't overlap with
subpartitions_cpus and invalidate the partition if that happens.

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