Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cgroups: remove isolated cpus from cpuset.cpus
In case the system was booted with isolcpus=n_i-n_j,n_k,n_m we cannot simply copy the cpuset.cpus file from our parent cgroup. For example, in the root cgroup cpuset.cpus will contain all of the cpus including the isolated cpus. Copying the values of the root cgroup into a child cgroup will lead to a wrong view in /proc/self/status: For the root cgroup /sys/fs/cgroup/cpuset /proc/self/status will correctly show Cpus_allowed_list: 0-1,3 even though cpuset.cpus will show 0-3 However, initializing a subcgroup in the cpuset controller by copying the cpuset.cpus setting from the root cgroup will cause /proc/self/status to incorrectly show Cpus_allowed_list: 0-3 Hence, we need to make sure to remove the isolated cpus from cpuset.cpus. Seth has argued that this is not a kernel bug but by design. So let us be the smart guys and fix this in liblxc. The solution is straightforward: To avoid having to work with raw cpulist strings we create cpumasks based on uint32_t bit arrays. Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
- Loading branch information
Christian Brauner
committed
Nov 9, 2016
1 parent
000dfda
commit a54694f
Showing
2 changed files
with
280 additions
and
51 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
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