Lines Matching +full:non +full:- +full:descriptive
1 .. _cgroup-v2:
11 conventions of cgroup v2. It describes all userland-visible aspects
14 v1 is available under :ref:`Documentation/admin-guide/cgroup-v1/index.rst <cgroup-v1>`.
22 1-1. Terminology
23 1-2. What is cgroup?
25 2-1. Mounting
26 2-2. Organizing Processes and Threads
27 2-2-1. Processes
28 2-2-2. Threads
29 2-3. [Un]populated Notification
30 2-4. Controlling Controllers
31 2-4-1. Availability
32 2-4-2. Enabling and Disabling
33 2-4-3. Top-down Constraint
34 2-4-4. No Internal Process Constraint
35 2-5. Delegation
36 2-5-1. Model of Delegation
37 2-5-2. Delegation Containment
38 2-6. Guidelines
39 2-6-1. Organize Once and Control
40 2-6-2. Avoid Name Collisions
42 3-1. Weights
43 3-2. Limits
44 3-3. Protections
45 3-4. Allocations
47 4-1. Format
48 4-2. Conventions
49 4-3. Core Interface Files
51 5-1. CPU
52 5-1-1. CPU Interface Files
53 5-2. Memory
54 5-2-1. Memory Interface Files
55 5-2-2. Usage Guidelines
56 5-2-3. Reclaim Protection
57 5-2-4. Memory Ownership
58 5-3. IO
59 5-3-1. IO Interface Files
60 5-3-2. Writeback
61 5-3-3. IO Latency
62 5-3-3-1. How IO Latency Throttling Works
63 5-3-3-2. IO Latency Interface Files
64 5-3-4. IO Priority
65 5-4. PID
66 5-4-1. PID Interface Files
67 5-5. Cpuset
68 5.5-1. Cpuset Interface Files
69 5-6. Device controller
70 5-7. RDMA
71 5-7-1. RDMA Interface Files
72 5-8. DMEM
73 5-8-1. DMEM Interface Files
74 5-9. HugeTLB
75 5.9-1. HugeTLB Interface Files
76 5-10. Misc
77 5.10-1 Misc Interface Files
78 5.10-2 Migration and Ownership
79 5-11. Others
80 5-11-1. perf_event
81 5-N. Non-normative information
82 5-N-1. CPU controller root cgroup process behaviour
83 5-N-2. IO controller root cgroup process behaviour
85 6-1. Basics
86 6-2. The Root and Views
87 6-3. Migration and setns(2)
88 6-4. Interaction with Other Namespaces
90 P-1. Filesystem Support for Writeback
93 R-1. Multiple Hierarchies
94 R-2. Thread Granularity
95 R-3. Competition Between Inner Nodes and Threads
96 R-4. Other Interface Issues
97 R-5. Controller Issues and Remedies
98 R-5-1. Memory
105 -----------
114 ---------------
120 cgroup is largely composed of two parts - the core and controllers.
136 hierarchical - if a controller is enabled on a cgroup, it affects all
138 sub-hierarchy of the cgroup. When a controller is enabled on a nested
148 --------
153 # mount -t cgroup2 none $MOUNT_POINT
163 is no longer referenced in its current hierarchy. Because per-cgroup
170 to inter-controller dependencies, other controllers may need to be
191 ignored on non-init namespace mounts. Please refer to the
208 option is ignored on non-init namespace mounts.
216 behavior but is a mount-option to avoid regressing setups
230 controller. The pre-allocated pool does not belong to anyone.
250 The option restores v1-like behavior of pids.events:max, that is only
258 --------------------------------
264 A child cgroup can be created by creating a sub-directory::
269 structure. Each cgroup has a read-writable interface file
271 belong to the cgroup one-per-line. The PIDs are not ordered and the
302 0::/test-cgroup/test-cgroup-nested
309 0::/test-cgroup/test-cgroup-nested (deleted)
335 constraint - threaded controllers can be enabled on non-leaf cgroups
359 - As the cgroup will join the parent's resource domain. The parent
362 - When the parent is an unthreaded domain, it must not have any domain
366 Topology-wise, a cgroup can be in an invalid state. Please consider
369 A (threaded domain) - B (threaded) - C (domain, just created)
384 threads in the cgroup. Except that the operations are per-thread
385 instead of per-process, "cgroup.threads" has the same format and
407 between threads in a non-leaf cgroup and its child cgroups. Each
413 - cpu
414 - cpuset
415 - perf_event
416 - pids
419 --------------------------
421 Each non-root cgroup has a "cgroup.events" file which contains
422 "populated" field indicating whether the cgroup's sub-hierarchy has
426 example, to start a clean-up operation after all processes of a given
427 sub-hierarchy have exited. The populated state updates and
428 notifications are recursive. Consider the following sub-hierarchy
432 A(4) - B(0) - C(1)
442 -----------------------
465 # echo "+cpu +memory -io" > cgroup.subtree_control
474 Consider the following sub-hierarchy. The enabled controllers are
477 A(cpu,memory) - B(memory) - C()
491 controller interface files - anything which doesn't start with
495 Top-down Constraint
498 Resources are distributed top-down and a cgroup can further distribute
500 parent. This means that all non-root "cgroup.subtree_control" files
510 Non-root cgroups can distribute domain resources to their children
525 refer to the Non-normative information section in the Controllers
538 ----------
560 delegated, the user can build sub-hierarchy under the directory,
564 happens in the delegated sub-hierarchy, nothing can escape the
568 cgroups in or nesting depth of a delegated sub-hierarchy; however,
575 A delegated sub-hierarchy is contained in the sense that processes
576 can't be moved into or out of the sub-hierarchy by the delegatee.
579 requiring the following conditions for a process with a non-root euid
583 - The writer must have write access to the "cgroup.procs" file.
585 - The writer must have write access to the "cgroup.procs" file of the
589 processes around freely in the delegated sub-hierarchy it can't pull
590 in from or push out to outside the sub-hierarchy.
596 ~~~~~~~~~~~~~ - C0 - C00
599 ~~~~~~~~~~~~~ - C1 - C10
606 will be denied with -EACCES.
611 is not reachable, the migration is rejected with -ENOENT.
615 ----------
623 inherent trade-offs between migration and various hot paths in terms
629 resource structure once on start-up. Dynamic adjustments to resource
662 -------
668 work-conserving. Due to the dynamic nature, this model is usually
683 .. _cgroupv2-limits-distributor:
686 ------
689 Limits can be over-committed - the sum of the limits of children can
694 As limits can be over-committed, all configuration combinations are
701 .. _cgroupv2-protections-distributor:
704 -----------
709 soft boundaries. Protections can also be over-committed in which case
716 As protections can be over-committed, all configuration combinations
720 "memory.low" implements best-effort memory protection and is an
725 -----------
728 resource. Allocations can't be over-committed - the sum of the
735 As allocations can't be over-committed, some configuration
740 "cpu.rt.max" hard-allocates realtime slices and is an example of this
748 ------
753 New-line separated values
761 (when read-only or multiple values can be written at once)
787 -----------
789 - Settings for a single feature should be contained in a single file.
791 - The root cgroup should be exempt from resource control and thus
794 - The default time unit is microseconds. If a different unit is ever
797 - A parts-per quantity should use a percentage decimal with at least
798 two digit fractional part - e.g. 13.40.
800 - If a controller implements weight based resource distribution, its
806 - If a controller implements an absolute resource guarantee and/or
815 - If a setting has a configurable default value and keyed specific
829 # cat cgroup-example-interface-file
835 # echo 125 > cgroup-example-interface-file
839 # echo "default 125" > cgroup-example-interface-file
843 # echo "8:16 170" > cgroup-example-interface-file
847 # echo "8:0 default" > cgroup-example-interface-file
848 # cat cgroup-example-interface-file
852 - For events which are not very high frequency, an interface file
859 --------------------
864 A read-write single value file which exists on non-root
870 - "domain" : A normal valid domain cgroup.
872 - "domain threaded" : A threaded domain cgroup which is
875 - "domain invalid" : A cgroup which is in an invalid state.
879 - "threaded" : A threaded cgroup which is a member of a
886 A read-write new-line separated values file which exists on
890 the cgroup one-per-line. The PIDs are not ordered and the
899 - It must have write access to the "cgroup.procs" file.
901 - It must have write access to the "cgroup.procs" file of the
904 When delegating a sub-hierarchy, write access to this file
912 A read-write new-line separated values file which exists on
916 the cgroup one-per-line. The TIDs are not ordered and the
925 - It must have write access to the "cgroup.threads" file.
927 - The cgroup that the thread is currently in must be in the
930 - It must have write access to the "cgroup.procs" file of the
933 When delegating a sub-hierarchy, write access to this file
937 A read-only space separated values file which exists on all
944 A read-write space separated values file which exists on all
951 Space separated list of controllers prefixed with '+' or '-'
953 name prefixed with '+' enables the controller and '-'
959 A read-only flat-keyed file which exists on non-root cgroups.
971 A read-write single value files. The default is "max".
978 A read-write single value files. The default is "max".
985 A read-only flat-keyed file with the following entries:
1011 A read-only flat-keyed file which exists in non-root cgroups.
1029 A read-write single value file which exists on non-root cgroups.
1052 create new sub-cgroups.
1055 A write-only single value file which exists in non-root cgroups.
1067 the whole thread-group.
1070 A read-write single value file that allowed values are "0" and "1".
1074 Writing "1" to the file will re-enable the cgroup PSI accounting.
1082 This may cause non-negligible overhead for some workloads when under
1084 be used to disable PSI accounting in the non-leaf cgroups.
1087 A read-write nested-keyed file.
1095 .. _cgroup-v2-cpu:
1098 ---
1116 management software may already have placed RT processes into non-root cgroups
1135 * Processes under the fair-class scheduler
1140 For details on when a process is under the fair-class scheduler or a BPF scheduler,
1141 check out :ref:`Documentation/scheduler/sched-ext.rst <sched-ext>`.
1147 A read-only flat-keyed file.
1153 - usage_usec
1154 - user_usec
1155 - system_usec
1158 only the processes under the fair-class scheduler:
1160 - nr_periods
1161 - nr_throttled
1162 - throttled_usec
1163 - nr_bursts
1164 - burst_usec
1167 A read-write single value file which exists on non-root
1170 For non idle groups (cpu.idle = 0), the weight is in the
1176 This file affects only processes under the fair-class scheduler and a BPF
1181 A read-write single value file which exists on non-root
1184 The nice value is in the range [-20, 19].
1192 This file affects only processes under the fair-class scheduler and a BPF
1197 A read-write two value file which exists on non-root cgroups.
1208 This file affects only processes under the fair-class scheduler.
1211 A read-write single value file which exists on non-root
1216 This file affects only processes under the fair-class scheduler.
1219 A read-write nested-keyed file.
1227 A read-write single value file which exists on non-root cgroups.
1245 A read-write single value file which exists on non-root cgroups.
1259 A read-write single value file which exists on non-root cgroups.
1262 This is the cgroup analog of the per-task SCHED_IDLE sched policy.
1268 This file affects only processes under the fair-class scheduler.
1271 ------
1279 While not completely water-tight, all major memory usages by a given
1284 - Userland memory - page cache and anonymous memory.
1286 - Kernel data structures such as dentries and inodes.
1288 - TCP socket buffers.
1301 A read-only single value file which exists on non-root
1308 A read-write single value file which exists on non-root
1331 A read-write single value file which exists on non-root
1334 Best-effort memory protection. If the memory usage of a
1354 A read-write single value file which exists on non-root
1377 busy-hitting its memory to slow down reclaim.
1380 A read-write single value file which exists on non-root
1389 In default configuration regular 0-order allocations always
1394 as -ENOMEM or silently ignore in cases like disk readahead.
1397 reclaim and oom-kill are bypassed. This is useful for admin
1400 The job will trigger the reclaim and/or oom-kill on its next
1406 busy-hitting its memory to slow down reclaim.
1409 A write-only nested-keyed file which exists for all cgroups.
1420 specified amount, -EAGAIN is returned.
1440 The valid range for swappiness is [0-200, max], setting
1444 A read-write single value file which exists on non-root cgroups.
1449 A write of any non-empty string to this file resets it to the
1454 A read-write single value file which exists on non-root
1464 Tasks with the OOM protection (oom_score_adj set to -1000)
1472 A read-only flat-keyed file which exists on non-root cgroups.
1486 boundary is over-committed.
1506 considered as an option, e.g. for failed high-order
1526 A read-only flat-keyed file which exists on non-root cgroups.
1529 types of memory, type-specific details, and other information
1538 If the entry has no per-node counter (or not show in the
1539 memory.numa_stat). We use 'npn' (non-per-node) as the tag
1570 Amount of memory used for storing per-cpu kernel
1580 Amount of cached filesystem data that is swap-backed,
1620 Amount of memory, swap-backed and filesystem-backed,
1626 the value for the foo counter, since the foo counter is type-based, not
1627 list-based.
1638 Amount of memory used for storing in-kernel data
1728 Number of zero-filled pages swapped out with I/O skipped due to the
1787 A read-only nested-keyed file which exists on non-root cgroups.
1790 types of memory, type-specific details, and other information
1812 A read-only single value file which exists on non-root
1819 A read-write single value file which exists on non-root
1824 allow userspace to implement custom out-of-memory procedures.
1835 A read-write single value file which exists on non-root cgroups.
1840 A write of any non-empty string to this file resets it to the
1845 A read-write single value file which exists on non-root
1852 A read-only flat-keyed file which exists on non-root cgroups.
1868 because of running out of swap system-wide or max
1877 A read-only single value file which exists on non-root
1884 A read-write single value file which exists on non-root
1892 A read-write single value file. The default value is "1".
1910 A read-only nested-keyed file.
1920 Over-committing on high limit (sum of high limits > available memory)
1934 pressure - how much the workload is being impacted due to lack of
1935 memory - is necessary to determine whether a workload needs more
1948 root - ... - A - B - C
1970 To which cgroup the area will be charged is in-deterministic; however,
1981 --
1986 only if cfq-iosched is in use and neither scheme is available for
1987 blk-mq devices.
1994 A read-only nested-keyed file.
2014 A read-write nested-keyed file which exists only on the root
2026 enable Weight-based control enable
2058 devices which show wide temporary behavior changes - e.g. a
2069 A read-write nested-keyed file which exists only on the root
2082 model The cost model in use - "linear"
2108 generate device-specific coefficients.
2111 A read-write flat-keyed file which exists on non-root cgroups.
2131 A read-write nested-keyed file which exists on non-root
2145 When writing, any number of nested key-value pairs can be
2170 A read-only nested-keyed file.
2189 writes out dirty pages for the memory domain. Both system-wide and
2190 per-cgroup dirty memory states are examined and the more restrictive
2228 memory controller and system-wide clean memory.
2261 your real setting, setting at 10-15% higher than the value in io.stat.
2271 - Queue depth throttling. This is the number of outstanding IO's a group is
2275 - Artificial delay induction. There are certain types of IO that cannot be
2322 no-change
2325 promote-to-rt
2326 For requests that have a non-RT I/O priority class, change it into RT.
2330 restrict-to-be
2340 none-to-rt
2341 Deprecated. Just an alias for promote-to-rt.
2345 +----------------+---+
2346 | no-change | 0 |
2347 +----------------+---+
2348 | promote-to-rt | 1 |
2349 +----------------+---+
2350 | restrict-to-be | 2 |
2351 +----------------+---+
2353 +----------------+---+
2357 +-------------------------------+---+
2359 +-------------------------------+---+
2360 | IOPRIO_CLASS_RT (real-time) | 1 |
2361 +-------------------------------+---+
2363 +-------------------------------+---+
2365 +-------------------------------+---+
2369 - If I/O priority class policy is promote-to-rt, change the request I/O
2372 - If I/O priority class policy is not promote-to-rt, translate the I/O priority
2378 ---
2397 A read-write single value file which exists on non-root
2403 A read-only single value file which exists on non-root cgroups.
2409 A read-only single value file which exists on non-root cgroups.
2415 A read-only flat-keyed file which exists on non-root cgroups. Unless
2433 through fork() or clone(). These will return -EAGAIN if the creation
2438 ------
2445 memory placement to reduce cross-node memory access and contention
2456 A read-write multiple values file which exists on non-root
2457 cpuset-enabled cgroups.
2464 The CPU numbers are comma-separated numbers or ranges.
2468 0-4,6,8-10
2471 setting as the nearest cgroup ancestor with a non-empty
2478 A read-only multiple values file which exists on all
2479 cpuset-enabled cgroups.
2495 A read-write multiple values file which exists on non-root
2496 cpuset-enabled cgroups.
2503 The memory node numbers are comma-separated numbers or ranges.
2507 0-1,3
2510 setting as the nearest cgroup ancestor with a non-empty
2517 Setting a non-empty value to "cpuset.mems" causes memory of
2529 A read-only multiple values file which exists on all
2530 cpuset-enabled cgroups.
2545 A read-write multiple values file which exists on non-root
2546 cpuset-enabled cgroups.
2579 A read-only multiple values file which exists on all non-root
2580 cpuset-enabled cgroups.
2592 A read-only and root cgroup only multiple values file.
2599 A read-write single value file which exists on non-root
2600 cpuset-enabled cgroups. This flag is owned by the parent cgroup
2606 "member" Non-root member of a partition
2611 A cpuset partition is a collection of cpuset-enabled cgroups with
2618 There are two types of partitions - local and remote. A local
2634 be changed. All other non-root cgroups start out as "member".
2647 two possible states - valid or invalid. An invalid partition
2658 "member" Non-root member of a partition
2665 In the case of an invalid partition root, a descriptive string on
2685 A valid non-root parent partition may distribute out all its CPUs
2704 A user can pre-configure certain CPUs to an isolated state
2711 -----------------
2722 on the return value the attempt will succeed or fail with -EPERM.
2727 If the program returns 0, the attempt fails with -EPERM, otherwise it
2735 ----
2744 A readwrite nested-keyed file that exists for all the cgroups
2765 A read-only file that describes current resource usage.
2774 ----
2784 A readwrite nested-keyed file that exists for all the cgroups
2797 A read-only file that describes maximum region capacity.
2808 A read-only file that describes current resource usage.
2817 -------
2834 A read-only flat-keyed file which exists on non-root cgroups.
2847 use hugetlb pages are included. The per-node values are in bytes.
2850 ----
2872 A read-only flat-keyed file shown only in the root cgroup. It shows
2881 A read-only flat-keyed file shown in the all cgroups. It shows
2889 A read-only flat-keyed file shown in all cgroups. It shows the
2898 A read-write flat-keyed file shown in the non root cgroups. Allowed
2917 A read-only flat-keyed file which exists on non-root cgroups. The
2940 ------
2951 Non-normative information
2952 -------------------------
2968 appropriately so the neutral - nice 0 - value is 100 instead of 1024).
2984 ------
3003 The path '/batchjobs/container_id1' can be considered as system-data
3008 # ls -l /proc/self/ns/cgroup
3009 lrwxrwxrwx 1 root root 0 2014-07-15 10:37 /proc/self/ns/cgroup -> cgroup:[4026531835]
3015 # ls -l /proc/self/ns/cgroup
3016 lrwxrwxrwx 1 root root 0 2014-07-15 10:35 /proc/self/ns/cgroup -> cgroup:[4026532183]
3020 When some thread from a multi-threaded process unshares its cgroup
3032 ------------------
3043 # ~/unshare -c # unshare cgroupns in some cgroup
3051 Each process gets its namespace-specific view of "/proc/$PID/cgroup"
3082 ----------------------
3111 ---------------------------------
3114 running inside a non-init cgroup namespace::
3116 # mount -t cgroup2 none $MOUNT_POINT
3123 the view of cgroup hierarchy by namespace-private cgroupfs mount
3136 --------------------------------
3139 address_space_operations->writepages() to annotate bio's using the
3156 super_block by setting SB_I_CGROUPWB in ->s_iflags. This allows for
3173 - Multiple hierarchies including named ones are not supported.
3175 - All v1 mount options are not supported.
3177 - The "tasks" file is removed and "cgroup.procs" is not sorted.
3179 - "cgroup.clone_children" is removed.
3181 - /proc/cgroups is meaningless for v2. Use "cgroup.controllers" or
3189 --------------------
3242 ------------------
3250 Generally, in-process knowledge is available only to the process
3251 itself; thus, unlike service-level organization of processes,
3258 sub-hierarchies and control resource distributions along them. This
3259 effectively raised cgroup to the status of a syscall-like API exposed
3269 that the process would actually be operating on its own sub-hierarchy.
3273 system-management pseudo filesystem. cgroup ended up with interface
3276 individual applications through the ill-defined delegation mechanism
3286 -------------------------------------------
3297 cycles and the number of internal threads fluctuated - the ratios
3313 clearly defined. There were attempts to add ad-hoc behaviors and
3327 ----------------------
3331 was how an empty cgroup was notified - a userland helper binary was
3334 to in-kernel event delivery filtering mechanism further complicating
3356 ------------------------------
3363 global reclaim prefers is opt-in, rather than opt-out. The costs for
3373 becomes self-defeating.
3375 The memory.low boundary on the other hand is a top-down allocated
3413 new limit is met - or the task writing to memory.max is killed.
3422 groups can sabotage swapping by other means - such as referencing its
3423 anonymous memory in a tight loop - and an admin can not assume full