forked from torvalds/linux
Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
cgroup/cpuset: Properly transition to invalid partition
For cpuset partition, the special state of PRS_ERROR (invalid partition root) was originally designed to handle hotplug events. In this state, CPUs allocated to the partition root is released back to the parent but the cpuset exclusive flags remain unchanged. Changing a cpuset into a partition root is strictly controlled. The following constraints must be satisfied in order to make the transition possible: - The "cpuset.cpus" is not empty and the list of CPUs are exclusive, i.e. they are not shared by any of its siblings. - The parent cgroup is a partition root. - The "cpuset.cpus" is a subset of the parent's "cpuset.cpus.effective". - There is no child cgroups with cpuset enabled. Changing a partition root back to a member is always allowed, though care must be taken to make sure that this change won't break child cpusets, if present. Since partition root sets the CPU_EXCLUSIVE flag, cpuset.cpus changes that break the cpu exclusivity rule will not be allowed. However, other changes to cpuset.cpus on a partition root may still cause it to become invalid. So users must always check the partition root state of "cpuset.cpus.partition" after making changes to cpuset.cpus to make sure that the partition root is still valid. For a partition root tree with parent and child partition roots, there are two cases where the child partitions can become invalid. Firstly, changing partition state to "member" will force the child partitions to become invalid. Secondly, if some cpus are taken away from the parent partition root so that its cpuset.cpus.effective becomes empty, it will try to pull cpus away from the child partitions and force them to become invalid which may allow the parent partition to remain valid. This patch makes sure that partitions are properly changed to invalid when some of the valid partition constraints are violated. Signed-off-by: Waiman Long <longman@redhat.com>
- Loading branch information
1 parent
c5b6c8a
commit 56ec7dd271c77e3cc92f0df6fd766004a7a0aa88
Showing
1 changed file
with
100 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters