Documentation: cgroup: clarify controller enabling semantics
Subsystems (2)
PATCH 1/1 Documentation: cgroup: clarify controller enabling semantics
The documentation for cgroup controller management has been updated to be more consistent regarding following concepts:
What does it mean to have controllers
1) available in a cgroup, vs.
2) enabled in a cgroup
Which has been clearly defined below in the documentation.
"Enabling a controller in a cgroup indicates that the distribution of the target resource across its immediate children will be controlled. Consider the following sub-hierarchy"
As an example, consider
/sys/fs/cgroup # cat cgroup.controllers
cpuset cpu io memory hugetlb pids misc/sys/fs/cgroup # cat cgroup.subtree_control # No controllers by default /sys/fs/cgroup # echo +cpu +memory > cgroup.subtree_control /sys/fs/cgroup # cat cgroup.subtree_control
cpu memory # cpu and memory enabled in /sys/fs/cgroup/sys/fs/cgroup # mkdir foo_cgrp/sys/fs/cgroup # cd foo_cgrp//sys/fs/cgroup/foo_cgrp # cat cgroup.controllers
cpu memory # cpu and memory available in 'foo_cgrp'/sys/fs/cgroup/foo_cgrp # cat cgroup.subtree_control # empty by default /sys/fs/cgroup/foo_cgrp # ls
cgroup.controllers cpu.max.burst memory.numa_stat cgroup.events cpu.pressure memory.oom.group cgroup.freeze cpu.stat memory.peak cgroup.kill cpu.stat.local memory.pressure cgroup.max.depth cpu.weight memory.reclaim cgroup.max.descendants cpu.weight.nice memory.stat cgroup.pressure io.pressure memory.swap.current cgroup.procs memory.current memory.swap.events cgroup.stat memory.events memory.swap.high cgroup.subtree_control memory.events.local memory.swap.max cgroup.threads memory.high memory.swap.peak cgroup.type memory.low memory.zswap.current cpu.idle memory.max memory.zswap.max cpu.max memory.min memory.zswap.writeback
Once a controller is available in a cgroup it can be used to resource control processes of the cgroup.
--- Documentation/admin-guide/cgroup-v2.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/admin-guide/cgroup-v2.rst +2 -2
@@ -438,8 +438,8 @@ Controlling Controllers Enabling and Disabling ~~~~~~~~~~~~~~~~~~~~~~ -Each cgroup has a "cgroup.controllers" file which lists all -controllers available for the cgroup to enable:: +Each cgroup has a cgroup.controllers file, which lists all the controllers +available for that cgroup and which can be enabled for its children. # cat cgroup.controllers cpu io memory
Signature · 1 line
2.49.0
Michal Koutný
maintainerHello.
Documentation/admin-guide/cgroup-v2.rst Controlling Controllers · line 445
Quoted 13 lines · Vishal Chourasia
Documentation/admin-guide/cgroup-v2.rst +2
-2@@ -438,8 +438,8 @@ Controlling Controllers Enabling and Disabling ~~~~~~~~~~~~~~~~~~~~~~ -Each cgroup has a "cgroup.controllers" file which lists all -controllers available for the cgroup to enable:: +Each cgroup has a cgroup.controllers file, which lists all the controllers +available for that cgroup and which can be enabled for its children. # cat cgroup.controllers cpu io memory
Honestly, I see little difference between the two resulting formulations. Could you perhaps add an example where the documentation confused you or behavior was not what you expected based on the docs?
Thanks,
Michal
Quoted 14 lines · Michal Koutný
Hello.
Quoted 11 lines · Vishal Chourasia
Documentation/admin-guide/cgroup-v2.rst +2
-2@@ -438,8 +438,8 @@ Controlling Controllers Enabling and Disabling ~~~~~~~~~~~~~~~~~~~~~~ -Each cgroup has a "cgroup.controllers" file which lists all -controllers available for the cgroup to enable:: +Each cgroup has a cgroup.controllers file, which lists all the controllers +available for that cgroup and which can be enabled for its children.
Quoted 6 lines
Documentation/admin-guide/cgroup-v2.rst Controlling Controllers · line 445
Quoted 2 lines
Documentation/admin-guide/cgroup-v2.rst +0
-0# cat cgroup.controllers cpu io memoryHonestly, I see little difference between the two resulting formulations. Could you perhaps add an example where the documentation confused you or behavior was not what you expected based on the docs?
Hello Michal,
The part that was confused me, was the meaning behind controller being available vs. enabled in a cgroup.
Though, the documentation does mention what it means for a controller to be enabled in a cgroup later in the text. But at the point of the change it is unclear.
Thanks
Vishal
Quoted 3 lines
Thanks,
Michal
Michal Koutný
maintainerQuoted 6 lines · Vishal Chourasia
The part that was confused me, was the meaning behind controller being available vs. enabled in a cgroup.
Though, the documentation does mention what it means for a controller to be enabled in a cgroup later in the text. But at the point of the change it is unclear.
There's a picture [1] that may be more descriptive than the docs (on which it is based).
HTH,
Michal
Quoted 10 lines · Michal Koutný
Quoted 6 lines · Vishal Chourasia
The part that was confused me, was the meaning behind controller being available vs. enabled in a cgroup.
Though, the documentation does mention what it means for a controller to be enabled in a cgroup later in the text. But at the point of the change it is unclear.
There's a picture [1] that may be more descriptive than the docs (on which it is based).
Thanks for the reference.
I didn't get the part about "io controller enabling memory controller too". Is it referring to the fact that multiple controller can work together in a cgroup? Because, enabling just the io controller does not automatically enable memory controller too.
Okay, what do you suggest, should I send out V2 taking corrections from others?
Regards,
Vishal
Quoted 5 lines
HTH,
Michal
Quoted 14 lines · Michal Koutný
Hello.
Quoted 11 lines · Vishal Chourasia
Documentation/admin-guide/cgroup-v2.rst +2
-2@@ -438,8 +438,8 @@ Controlling Controllers Enabling and Disabling ~~~~~~~~~~~~~~~~~~~~~~ -Each cgroup has a "cgroup.controllers" file which lists all -controllers available for the cgroup to enable:: +Each cgroup has a cgroup.controllers file, which lists all the controllers +available for that cgroup and which can be enabled for its children.
Quoted 6 lines
Documentation/admin-guide/cgroup-v2.rst Controlling Controllers · line 445
Quoted 2 lines
Documentation/admin-guide/cgroup-v2.rst +0
-0# cat cgroup.controllers cpu io memoryHonestly, I see little difference between the two resulting formulations. Could you perhaps add an example where the documentation confused you or behavior was not what you expected based on the docs?
You are right, there is little difference. I wanted to highlight the point, that, Availablity means controller can be used to resource control a cgroup, while Enablement means controller is now "availble" to children of the cgroup.
Regards,
Vishal
Quoted 3 lines
Thanks,
Michal
Documentation/admin-guide/cgroup-v2.rst Controlling Controllers · line 442
Quoted 12 lines · Vishal Chourasia
Documentation/admin-guide/cgroup-v2.rst +2
-2@@ -438,8 +438,8 @@ Controlling Controllers Enabling and Disabling ~~~~~~~~~~~~~~~~~~~~~~ -Each cgroup has a "cgroup.controllers" file which lists all -controllers available for the cgroup to enable:: +Each cgroup has a cgroup.controllers file, which lists all the controllers +available for that cgroup and which can be enabled for its children.
Keep the double colon (literal code block).
Quoted 6 lines
Documentation/admin-guide/cgroup-v2.rst +0
-0# cat cgroup.controllers cpu io memorySignature · 1 line
2.49.0
Thanks.
Signature · 1 line
An old man doll... just what I always wanted! - Clara
Quoted 9 lines · Bagas Sanjaya
Quoted 8 lines · Vishal Chourasia
Documentation/admin-guide/cgroup-v2.rst +0
-0@@ -438,8 +438,8 @@ Controlling Controllers Enabling and Disabling ~~~~~~~~~~~~~~~~~~~~~~
Quoted 6 lines
Documentation/admin-guide/cgroup-v2.rst Controlling Controllers · line 442
Quoted 4 lines
Documentation/admin-guide/cgroup-v2.rst +2
-2-Each cgroup has a "cgroup.controllers" file which lists all -controllers available for the cgroup to enable:: +Each cgroup has a cgroup.controllers file, which lists all the controllers +available for that cgroup and which can be enabled for its children.Keep the double colon (literal code block).
Sure, thanks!
Vishal
Quoted 12 lines
Quoted 7 lines
Documentation/admin-guide/cgroup-v2.rst +0
-0# cat cgroup.controllers cpu io memorySignature · 1 line
2.49.0Thanks.
Signature · 1 line
An old man doll... just what I always wanted! - Clara
Quoted 55 lines · Vishal Chourasia
The documentation for cgroup controller management has been updated to be more consistent regarding following concepts:
What does it mean to have controllers
1) available in a cgroup, vs.
2) enabled in a cgroupWhich has been clearly defined below in the documentation.
"Enabling a controller in a cgroup indicates that the distribution of the target resource across its immediate children will be controlled. Consider the following sub-hierarchy"
As an example, consider
/sys/fs/cgroup# cat cgroup.controllers
cpuset cpu io memory hugetlb pids misc/sys/fs/cgroup# cat cgroup.subtree_control # No controllers by default/sys/fs/cgroup# echo +cpu +memory > cgroup.subtree_control/sys/fs/cgroup# cat cgroup.subtree_control
cpu memory # cpu and memory enabled in/sys/fs/cgroup/sys/fs/cgroup# mkdirfoo_cgrp/sys/fs/cgroup# cd foo_cgrp//sys/fs/cgroup/foo_cgrp# cat cgroup.controllers
cpu memory # cpu and memory available in 'foo_cgrp'/sys/fs/cgroup/foo_cgrp# cat cgroup.subtree_control # empty by default/sys/fs/cgroup/foo_cgrp# lscgroup.controllers cpu.max.burst memory.numa_stat cgroup.events cpu.pressure memory.oom.group cgroup.freeze cpu.stat memory.peak cgroup.kill cpu.stat.local memory.pressure cgroup.max.depth cpu.weight memory.reclaim cgroup.max.descendants cpu.weight.nice memory.stat cgroup.pressure io.pressure memory.swap.current cgroup.procs memory.current memory.swap.events cgroup.stat memory.events memory.swap.high cgroup.subtree_control memory.events.local memory.swap.max cgroup.threads memory.high memory.swap.peak cgroup.type memory.low memory.zswap.current cpu.idle memory.max memory.zswap.max cpu.max memory.min memory.zswap.writebackOnce a controller is available in a cgroup it can be used to resource control processes of the cgroup.
Signed-off-by Vishal Chourasia <[email protected]>--- Documentation/admin-guide/cgroup-v2.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Documentation/admin-guide/cgroup-v2.rst +0
-0
Documentation/admin-guide/cgroup-v2.rst Controlling Controllers · line 442
Quoted 7 lines
Documentation/admin-guide/cgroup-v2.rst +2
-2@@ -438,8 +438,8 @@ Controlling Controllers Enabling and Disabling ~~~~~~~~~~~~~~~~~~~~~ -Each cgroup has a "cgroup.controllers" file which lists all -controllers available for the cgroup to enable:: +Each cgroup has a cgroup.controllers file, which lists all the controllers +available for that cgroup and which can be enabled for its children.
I believe breaking the sentence into two separate components is actually making it less correct. There are implicit controllers that are always enabled and do not show up in cgroup.controllers. Prime examples are perf_event and freezer. IOW, only controllers that are available and need to be explicitly enabled will show up.
Cheers,
Longman
Quoted 51 lines · Waiman Long
Quoted 50 lines · Vishal Chourasia
The documentation for cgroup controller management has been updated to be more consistent regarding following concepts:
What does it mean to have controllers
1) available in a cgroup, vs.
2) enabled in a cgroupWhich has been clearly defined below in the documentation.
"Enabling a controller in a cgroup indicates that the distribution of the target resource across its immediate children will be controlled. Consider the following sub-hierarchy"
As an example, consider
/sys/fs/cgroup# cat cgroup.controllers
cpuset cpu io memory hugetlb pids misc/sys/fs/cgroup# cat cgroup.subtree_control # No controllers by default/sys/fs/cgroup# echo +cpu +memory > cgroup.subtree_control/sys/fs/cgroup# cat cgroup.subtree_control
cpu memory # cpu and memory enabled in/sys/fs/cgroup/sys/fs/cgroup# mkdirfoo_cgrp/sys/fs/cgroup# cd foo_cgrp//sys/fs/cgroup/foo_cgrp# cat cgroup.controllers
cpu memory # cpu and memory available in 'foo_cgrp'/sys/fs/cgroup/foo_cgrp# cat cgroup.subtree_control # empty by default/sys/fs/cgroup/foo_cgrp# ls
cgroup.controllers cpu.max.burst memory.numa_stat cgroup.events cpu.pressure memory.oom.group cgroup.freeze cpu.stat memory.peak cgroup.kill cpu.stat.local memory.pressure cgroup.max.depth cpu.weight memory.reclaim cgroup.max.descendants cpu.weight.nice memory.stat cgroup.pressure io.pressure memory.swap.current cgroup.procs memory.current memory.swap.events cgroup.stat memory.events memory.swap.high cgroup.subtree_control memory.events.local memory.swap.max cgroup.threads memory.high memory.swap.peak cgroup.type memory.low memory.zswap.current cpu.idle memory.max memory.zswap.max cpu.max memory.min memory.zswap.writebackOnce a controller is available in a cgroup it can be used to resource control processes of the cgroup.
Signed-off-by Vishal Chourasia <[email protected]>---
Documentation/admin-guide/cgroup-v2.rst| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 14 lines
Quoted 10 lines
Documentation/admin-guide/cgroup-v2.rst +0
-0@@ -438,8 +438,8 @@ Controlling ControllersEnabling and Disabling
~~~~~~~~~~~~~~~~~~~~~
-Each cgroup has a "cgroup.controllers" file which lists allDocumentation/admin-guide/cgroup-v2.rst +1
-1-controllers available for the cgroup to enable:: +Each cgroup has a cgroup.controllers file, which lists all theQuoted 2 lines
controllers
+available for that cgroup and which can be enabled for its children.I believe breaking the sentence into two separate components is actually making it less correct. There are implicit controllers that are always enabled and do not show up in cgroup.controllers. Prime examples are
perf_eventand freezer. IOW, only controllers that are available and need to be explicitly enabled will show up.
A correction: The cgroup.controllers file shows the controllers that are available in the current cgroup and which have to be explicitly enabled in cgroup.subtree_control to make them available in the child cgroups.
Cheers,
Longman
Hi Longman,
Quoted 9 lines · Waiman Long
Quoted 6 lines · Waiman Long
I believe breaking the sentence into two separate components is actually making it less correct. There are implicit controllers that are always enabled and do not show up in cgroup.controllers. Prime examples are
perf_eventand freezer. IOW, only controllers that are available and need to be explicitly enabled will show up.
Quoted 4 lines
A correction: The cgroup.controllers file shows the controllers that are available in the current cgroup and which have to be explicitly enabled in cgroup.subtree_control to make them available in the child cgroups.
Thank you for pointing it out.
Vishal
Quoted 4 lines
Cheers,
Longman