From: Waiman Long <llong@redhat.com>
To: "Vishal Chourasia" <vishalc@linux.ibm.com>,
"Tejun Heo" <tj@kernel.org>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Michal Koutný" <mkoutny@suse.com>,
"Jonathan Corbet" <corbet@lwn.net>,
cgroups@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Documentation: cgroup: clarify controller enabling semantics
Date: Wed, 28 May 2025 11:45:29 -0400 [thread overview]
Message-ID: <a9d0e503-ec70-41a7-adb2-989082e4d9f2@redhat.com> (raw)
In-Reply-To: <99be9c8e-a5c4-4378-b03b-2af01608de9f@redhat.com>
On 5/28/25 11:23 AM, Waiman Long wrote:
> On 5/27/25 4:53 AM, Vishal Chourasia wrote:
>> 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.
>>
>> Signed-off-by: Vishal Chourasia <vishalc@linux.ibm.com>
>> ---
>> Documentation/admin-guide/cgroup-v2.rst | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/admin-guide/cgroup-v2.rst
>> b/Documentation/admin-guide/cgroup-v2.rst
>> index 1a16ce68a4d7..0e1686511c45 100644
>> --- a/Documentation/admin-guide/cgroup-v2.rst
>> +++ b/Documentation/admin-guide/cgroup-v2.rst
>> @@ -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.
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
next prev parent reply other threads:[~2025-05-28 15:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-27 8:53 [PATCH] Documentation: cgroup: clarify controller enabling semantics Vishal Chourasia
2025-05-27 9:58 ` Michal Koutný
2025-05-28 13:18 ` Vishal Chourasia
2025-05-28 17:05 ` Michal Koutný
2025-05-28 18:08 ` Vishal Chourasia
2025-05-28 13:31 ` Vishal Chourasia
2025-05-27 10:04 ` Bagas Sanjaya
2025-05-28 17:28 ` Vishal Chourasia
2025-05-28 15:23 ` Waiman Long
2025-05-28 15:45 ` Waiman Long [this message]
2025-05-28 17:37 ` Vishal Chourasia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a9d0e503-ec70-41a7-adb2-989082e4d9f2@redhat.com \
--to=llong@redhat.com \
--cc=cgroups@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=hannes@cmpxchg.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkoutny@suse.com \
--cc=tj@kernel.org \
--cc=vishalc@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).