4

In cgroups there seems to be an option called 'cgroup.clone_children' for each subsystem, that allows you to specify if the setting of the parent cgroup should be inherited into the child cgroups. But I have not been able to find any evidence that it works.

I was hoping to use this feature to more easily administer cgroups by using the hierarchy to copy settings that are common to all groups and only tweak minor settings in the children cgroups.

Anyone have an idea if what I am trying to do can be done?

elventear
  • 223
  • 1
  • 2
  • 6

1 Answers1

2

That's exactly what it does:

/dev/cgroup# mkdir parent
/dev/cgroup# cat parent/cpuset.cpus
0
/dev/cgroup# echo 1-2 > parent/cpuset.cpus
/dev/cgroup# cat parent/cpuset.cpus
1-2
/dev/cgroup# echo 1 > parent.clone_children
/dev/cgroup# mkdir parent/child
/dev/cgroup# cat parent/child/cpuset.cpus
1-2
bhawkfan
  • 51
  • 2
  • it seems like clone_children only affects cpuset, https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt – kevin Jul 09 '14 at 21:27
  • The previous comment is a broken link. The updated link is here: https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt. In cgroup-v2, clone_children is removed. https://www.kernel.org/doc/Documentation/cgroup-v2.txt. – mgarey Aug 27 '19 at 23:13