linux/Documentation
Vishal Chourasia 38b9342ee6 Documentation: cgroup: add section explaining controller availability
Add "Availability" section to Control Group v2 docs. It describes the
meaning of a controller being available in a cgroup, complementing the
existing "Enabling and Disabling" section.

This update improves the clarity of cgroup controller management by
explicitly distinguishing between:

1. Availability – when a controller is supported by the kernel and
   listed in "cgroup.controllers", making its interface files accessible
   in the cgroup's directory.
2. Enabling – when a controller is enabled via explicitly writing the
   name of the controller to "cgroup.subtree_control" to control
   distribution of resource across the cgroup's immediate children.

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 enabled by default
/sys/fs/cgroup # echo +cpu +memory > cgroup.subtree_control # enabling "cpu" and "memory"
/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

In this example, "cpu" and "memory" are enabled in the root cgroup,
making them available in "foo_cgrp". This exposes the corresponding
interface files in "foo_cgrp/", allowing resource control of processes
in that cgroup. However, these controllers are not yet enabled in
"foo_cgrp" itself.

Once a controller is available in a cgroup it can be used to resource
control processes of the cgroup.

Acked-by: Michal Koutný <mkoutny@suse.com>
Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Vishal Chourasia <vishalc@linux.ibm.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2025-06-09 08:05:13 -10:00
..
ABI - The 3 patch series "hung_task: extend blocking task stacktrace dump to 2025-05-31 19:12:53 -07:00
accel
accounting
admin-guide Documentation: cgroup: add section explaining controller availability 2025-06-09 08:05:13 -10:00
arch OpenRISC updates for 6.16 2025-06-01 08:56:34 -07:00
block
bpf bpf: Add support for __prog argument suffix to pass in prog->aux 2025-05-13 18:47:54 -07:00
cdrom
core-api vfs-6.16-rc1.netfs 2025-06-02 15:04:06 -07:00
cpu-freq
crypto
dev-tools Documentation: kunit: improve example on testing static functions 2025-05-19 13:22:21 -06:00
devicetree ata changes for 6.16-rc1 2025-06-03 09:42:38 -07:00
doc-guide Docs: doc-guide: update sphinx.rst Sphinx version number 2025-05-21 04:28:29 -06:00
driver-api Restructure the IPMI driver for 6.16 2025-05-29 21:37:11 -07:00
edac
fault-injection
fb fbdev: sstfb.rst: Fix spelling mistake 2025-05-31 10:24:02 +02:00
features
filesystems fuse update for 6.16 2025-06-02 15:31:05 -07:00
firmware_class
firmware-guide
fpga
gpu drm for 6.16-rc1 2025-05-28 09:46:39 -07:00
hid
hwmon hwmon updates for v6.16 2025-06-03 09:11:26 -07:00
i2c docs: i2c: Fix "resitors" to "resistors" 2025-05-20 11:22:16 +02:00
iio
images
infiniband
input Input: amijoy - make headings compliant w/ guidelines in documentation 2025-05-30 15:34:38 -07:00
isdn
kbuild require gcc-8 and binutils-2.30 2025-05-31 08:16:52 -07:00
kernel-hacking
leds Documentation: leds: improve readibility of multicolor doc 2025-05-07 01:02:57 -06:00
litmus-tests
livepatch
locking
maintainer
mhi
misc-devices
mm Docs/damon: update titles and brief introductions to explain DAMOS 2025-05-22 14:55:38 -07:00
netlabel
netlink net: Add support for providing the PTP hardware source in tsinfo 2025-05-22 15:32:00 +02:00
networking - The 11 patch series "Add folio_mk_pte()" from Matthew Wilcox 2025-05-31 15:44:16 -07:00
nvdimm
nvme
PCI
pcmcia
peci
power PM: EM: Documentation: Fix typos in example driver code 2025-05-13 14:30:01 +02:00
process - The 3 patch series "hung_task: extend blocking task stacktrace dump to 2025-05-31 19:12:53 -07:00
RCU doc/RCU/listRCU: refine example code for eliminating stale data 2025-05-16 09:00:54 -04:00
rust
scheduler sched_ext: Changes for v6.16 2025-05-27 21:12:50 -07:00
scsi scsi: docs: Clean up some style in scsi_mid_low_api 2025-05-12 22:11:55 -04:00
security
sound
sphinx docs: kerneldoc.py: simplify exception handling logic 2025-05-21 03:53:40 -06:00
sphinx-static
spi
staging rpmsg updates for v6.16 2025-06-02 11:06:44 -07:00
sunrpc/xdr
target
tee
timers
tools
trace tracing updates for v6.16: 2025-05-29 21:04:36 -07:00
translations - The 3 patch series "hung_task: extend blocking task stacktrace dump to 2025-05-31 19:12:53 -07:00
usb
userspace-api Networking changes for 6.16. 2025-05-28 15:24:36 -07:00
virt hyperv-next for v6.16 2025-06-03 08:39:20 -07:00
w1
watchdog
wmi platform/x86: dell-ddv: Expose the battery health to userspace 2025-05-12 13:20:42 +03:00
.gitignore
atomic_bitops.txt
atomic_t.txt
Changes
CodingStyle
conf.py docs: conf.py: drop backward support for old Sphinx versions 2025-05-19 08:02:14 -06:00
docutils.conf
index.rst docs: fix typo in firmware-related section 2025-05-07 00:53:22 -06:00
Kconfig
Makefile docs: Makefile: Inherit PYTHONPYCACHEPREFIX setting as env variable 2025-05-07 00:53:22 -06:00
memory-barriers.txt
SubmittingPatches
subsystem-apis.rst