sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget)/translations/zh_CN/admin-guide/cgroup-v2modnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/zh_TW/admin-guide/cgroup-v2modnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/it_IT/admin-guide/cgroup-v2modnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/ja_JP/admin-guide/cgroup-v2modnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/ko_KR/admin-guide/cgroup-v2modnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget)/translations/sp_SP/admin-guide/cgroup-v2modnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhtarget)}(h.. _cgroup-v2:h]h}(h]h ]h"]h$]h&]refid cgroup-v2uh1hhKhhhhhC/var/lib/git/docbuild/linux/Documentation/admin-guide/cgroup-v2.rstubhsection)}(hhh](htitle)}(hControl Group v2h]hControl Group v2}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh field_list)}(hhh](hfield)}(hhh](h field_name)}(hDateh]hDate}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhKubh field_body)}(h October, 2015h]h paragraph)}(hhh]h October, 2015}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(hAuthorh]hAuthor}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhKubh)}(hTejun Heo h]h)}(hTejun Heo h](h Tejun Heo <}(hjhhhNhNubh reference)}(h tj@kernel.orgh]h tj@kernel.org}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurimailto:tj@kernel.orguh1jhjubh>}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hXhThis is the authoritative documentation on the design, interface and conventions of cgroup v2. It describes all userland-visible aspects of cgroup including core and specific controller behaviors. All future changes must be reflected in this document. Documentation for v1 is available under :ref:`Documentation/admin-guide/cgroup-v1/index.rst `.h](hX'This is the authoritative documentation on the design, interface and conventions of cgroup v2. It describes all userland-visible aspects of cgroup including core and specific controller behaviors. All future changes must be reflected in this document. Documentation for v1 is available under }(hjKhhhNhNubh)}(h@:ref:`Documentation/admin-guide/cgroup-v1/index.rst `h]hinline)}(hjUh]h-Documentation/admin-guide/cgroup-v1/index.rst}(hjYhhhNhNubah}(h]h ](xrefstdstd-refeh"]h$]h&]uh1jWhjSubah}(h]h ]h"]h$]h&]refdocadmin-guide/cgroup-v2 refdomainjdreftyperef refexplicitrefwarn reftarget cgroup-v1uh1hhhhK hjKubh.}(hjKhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK hhhhubhcomment)}(hXCONTENTS 1. Introduction 1-1. Terminology 1-2. What is cgroup? 2. Basic Operations 2-1. Mounting 2-2. Organizing Processes and Threads 2-2-1. Processes 2-2-2. Threads 2-3. [Un]populated Notification 2-4. Controlling Controllers 2-4-1. Enabling and Disabling 2-4-2. Top-down Constraint 2-4-3. No Internal Process Constraint 2-5. Delegation 2-5-1. Model of Delegation 2-5-2. Delegation Containment 2-6. Guidelines 2-6-1. Organize Once and Control 2-6-2. Avoid Name Collisions 3. Resource Distribution Models 3-1. Weights 3-2. Limits 3-3. Protections 3-4. Allocations 4. Interface Files 4-1. Format 4-2. Conventions 4-3. Core Interface Files 5. Controllers 5-1. CPU 5-1-1. CPU Interface Files 5-2. Memory 5-2-1. Memory Interface Files 5-2-2. Usage Guidelines 5-2-3. Memory Ownership 5-3. IO 5-3-1. IO Interface Files 5-3-2. Writeback 5-3-3. IO Latency 5-3-3-1. How IO Latency Throttling Works 5-3-3-2. IO Latency Interface Files 5-3-4. IO Priority 5-4. PID 5-4-1. PID Interface Files 5-5. Cpuset 5.5-1. Cpuset Interface Files 5-6. Device 5-7. RDMA 5-7-1. RDMA Interface Files 5-8. DMEM 5-9. HugeTLB 5.9-1. HugeTLB Interface Files 5-10. Misc 5.10-1 Miscellaneous cgroup Interface Files 5.10-2 Migration and Ownership 5-11. Others 5-11-1. perf_event 5-N. Non-normative information 5-N-1. CPU controller root cgroup process behaviour 5-N-2. IO controller root cgroup process behaviour 6. Namespace 6-1. Basics 6-2. The Root and Views 6-3. Migration and setns(2) 6-4. Interaction with Other Namespaces P. Information on Kernel Programming P-1. Filesystem Support for Writeback D. Deprecated v1 Core Features R. Issues with v1 and Rationales for v2 R-1. Multiple Hierarchies R-2. Thread Granularity R-3. Competition Between Inner Nodes and Threads R-4. Other Interface Issues R-5. Controller Issues and Remedies R-5-1. Memoryh]hXCONTENTS 1. Introduction 1-1. Terminology 1-2. What is cgroup? 2. Basic Operations 2-1. Mounting 2-2. Organizing Processes and Threads 2-2-1. Processes 2-2-2. Threads 2-3. [Un]populated Notification 2-4. Controlling Controllers 2-4-1. Enabling and Disabling 2-4-2. Top-down Constraint 2-4-3. No Internal Process Constraint 2-5. Delegation 2-5-1. Model of Delegation 2-5-2. Delegation Containment 2-6. Guidelines 2-6-1. Organize Once and Control 2-6-2. Avoid Name Collisions 3. Resource Distribution Models 3-1. Weights 3-2. Limits 3-3. Protections 3-4. Allocations 4. Interface Files 4-1. Format 4-2. Conventions 4-3. Core Interface Files 5. Controllers 5-1. CPU 5-1-1. CPU Interface Files 5-2. Memory 5-2-1. Memory Interface Files 5-2-2. Usage Guidelines 5-2-3. Memory Ownership 5-3. IO 5-3-1. IO Interface Files 5-3-2. Writeback 5-3-3. IO Latency 5-3-3-1. How IO Latency Throttling Works 5-3-3-2. IO Latency Interface Files 5-3-4. IO Priority 5-4. PID 5-4-1. PID Interface Files 5-5. Cpuset 5.5-1. Cpuset Interface Files 5-6. Device 5-7. RDMA 5-7-1. RDMA Interface Files 5-8. DMEM 5-9. HugeTLB 5.9-1. HugeTLB Interface Files 5-10. Misc 5.10-1 Miscellaneous cgroup Interface Files 5.10-2 Migration and Ownership 5-11. Others 5-11-1. perf_event 5-N. Non-normative information 5-N-1. CPU controller root cgroup process behaviour 5-N-2. IO controller root cgroup process behaviour 6. Namespace 6-1. Basics 6-2. The Root and Views 6-3. Migration and setns(2) 6-4. Interaction with Other Namespaces P. Information on Kernel Programming P-1. Filesystem Support for Writeback D. Deprecated v1 Core Features R. Issues with v1 and Rationales for v2 R-1. Multiple Hierarchies R-2. Thread Granularity R-3. Competition Between Inner Nodes and Threads R-4. Other Interface Issues R-5. Controller Issues and Remedies R-5-1. Memory}hjsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1jhhhhhhhK^ubh)}(hhh](h)}(h Introductionh]h Introduction}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK`ubh)}(hhh](h)}(h Terminologyh]h Terminology}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKcubh)}(hX"cgroup" stands for "control group" and is never capitalized. The singular form is used to designate the whole feature and also as a qualifier as in "cgroup controllers". When explicitly referring to multiple individual control groups, the plural form "cgroups" is used.h]hX “cgroup” stands for “control group” and is never capitalized. The singular form is used to designate the whole feature and also as a qualifier as in “cgroup controllers”. When explicitly referring to multiple individual control groups, the plural form “cgroups” is used.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKehjhhubeh}(h] terminologyah ]h"] terminologyah$]h&]uh1hhjhhhhhKcubh)}(hhh](h)}(hWhat is cgroup?h]hWhat is cgroup?}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKlubh)}(hcgroup is a mechanism to organize processes hierarchically and distribute system resources along the hierarchy in a controlled and configurable manner.h]hcgroup is a mechanism to organize processes hierarchically and distribute system resources along the hierarchy in a controlled and configurable manner.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKnhjhhubh)}(hXccgroup is largely composed of two parts - the core and controllers. cgroup core is primarily responsible for hierarchically organizing processes. A cgroup controller is usually responsible for distributing a specific type of system resource along the hierarchy although there are utility controllers which serve purposes other than resource distribution.h]hXccgroup is largely composed of two parts - the core and controllers. cgroup core is primarily responsible for hierarchically organizing processes. A cgroup controller is usually responsible for distributing a specific type of system resource along the hierarchy although there are utility controllers which serve purposes other than resource distribution.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKrhjhhubh)}(hXtcgroups form a tree structure and every process in the system belongs to one and only one cgroup. All threads of a process belong to the same cgroup. On creation, all processes are put in the cgroup that the parent process belongs to at the time. A process can be migrated to another cgroup. Migration of a process doesn't affect already existing descendant processes.h]hXvcgroups form a tree structure and every process in the system belongs to one and only one cgroup. All threads of a process belong to the same cgroup. On creation, all processes are put in the cgroup that the parent process belongs to at the time. A process can be migrated to another cgroup. Migration of a process doesn’t affect already existing descendant processes.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKyhjhhubh)}(hXFollowing certain structural constraints, controllers may be enabled or disabled selectively on a cgroup. All controller behaviors are hierarchical - if a controller is enabled on a cgroup, it affects all processes which belong to the cgroups consisting the inclusive sub-hierarchy of the cgroup. When a controller is enabled on a nested cgroup, it always restricts the resource distribution further. The restrictions set closer to the root in the hierarchy can not be overridden from further away.h]hXFollowing certain structural constraints, controllers may be enabled or disabled selectively on a cgroup. All controller behaviors are hierarchical - if a controller is enabled on a cgroup, it affects all processes which belong to the cgroups consisting the inclusive sub-hierarchy of the cgroup. When a controller is enabled on a nested cgroup, it always restricts the resource distribution further. The restrictions set closer to the root in the hierarchy can not be overridden from further away.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]what-is-cgroupah ]h"]what is cgroup?ah$]h&]uh1hhjhhhhhKlubeh}(h] introductionah ]h"] introductionah$]h&]uh1hhhhhhhhK`ubh)}(hhh](h)}(hBasic Operationsh]hBasic Operations}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj%hhhhhKubh)}(hhh](h)}(hMountingh]hMounting}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj6hhhhhKubh)}(hzUnlike v1, cgroup v2 has only single hierarchy. The cgroup v2 hierarchy can be mounted with the following mount command::h]hyUnlike v1, cgroup v2 has only single hierarchy. The cgroup v2 hierarchy can be mounted with the following mount command:}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj6hhubh literal_block)}(h$# mount -t cgroup2 none $MOUNT_POINTh]h$# mount -t cgroup2 none $MOUNT_POINT}hjWsbah}(h]h ]h"]h$]h&]jjuh1jUhhhKhj6hhubh)}(hXcgroup2 filesystem has the magic number 0x63677270 ("cgrp"). All controllers which support v2 and are not bound to a v1 hierarchy are automatically bound to the v2 hierarchy and show up at the root. Controllers which are not in active use in the v2 hierarchy can be bound to other hierarchies. This allows mixing v2 hierarchy with the legacy v1 multiple hierarchies in a fully backward compatible way.h]hXcgroup2 filesystem has the magic number 0x63677270 (“cgrp”). All controllers which support v2 and are not bound to a v1 hierarchy are automatically bound to the v2 hierarchy and show up at the root. Controllers which are not in active use in the v2 hierarchy can be bound to other hierarchies. This allows mixing v2 hierarchy with the legacy v1 multiple hierarchies in a fully backward compatible way.}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj6hhubh)}(hXvA controller can be moved across hierarchies only after the controller is no longer referenced in its current hierarchy. Because per-cgroup controller states are destroyed asynchronously and controllers may have lingering references, a controller may not show up immediately on the v2 hierarchy after the final umount of the previous hierarchy. Similarly, a controller should be fully disabled to be moved out of the unified hierarchy and it may take some time for the disabled controller to become available for other hierarchies; furthermore, due to inter-controller dependencies, other controllers may need to be disabled too.h]hXvA controller can be moved across hierarchies only after the controller is no longer referenced in its current hierarchy. Because per-cgroup controller states are destroyed asynchronously and controllers may have lingering references, a controller may not show up immediately on the v2 hierarchy after the final umount of the previous hierarchy. Similarly, a controller should be fully disabled to be moved out of the unified hierarchy and it may take some time for the disabled controller to become available for other hierarchies; furthermore, due to inter-controller dependencies, other controllers may need to be disabled too.}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj6hhubh)}(hX)While useful for development and manual configurations, moving controllers dynamically between the v2 and other hierarchies is strongly discouraged for production use. It is recommended to decide the hierarchies and controller associations before starting using the controllers after system boot.h]hX)While useful for development and manual configurations, moving controllers dynamically between the v2 and other hierarchies is strongly discouraged for production use. It is recommended to decide the hierarchies and controller associations before starting using the controllers after system boot.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj6hhubh)}(hXKDuring transition to v2, system management software might still automount the v1 cgroup filesystem and so hijack all controllers during boot, before manual intervention is possible. To make testing and experimenting easier, the kernel parameter cgroup_no_v1= allows disabling controllers in v1 and make them always available in v2.h]hXKDuring transition to v2, system management software might still automount the v1 cgroup filesystem and so hijack all controllers during boot, before manual intervention is possible. To make testing and experimenting easier, the kernel parameter cgroup_no_v1= allows disabling controllers in v1 and make them always available in v2.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj6hhubh)}(h9cgroup v2 currently supports the following mount options.h]h9cgroup v2 currently supports the following mount options.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj6hhubh block_quote)}(hX nsdelegate Consider cgroup namespaces as delegation boundaries. This option is system wide and can only be set on mount or modified through remount from the init namespace. The mount option is ignored on non-init namespace mounts. Please refer to the Delegation section for details. favordynmods Reduce the latencies of dynamic cgroup modifications such as task migrations and controller on/offs at the cost of making hot path operations such as forks and exits more expensive. The static usage pattern of creating a cgroup, enabling controllers, and then seeding it with CLONE_INTO_CGROUP is not affected by this option. memory_localevents Only populate memory.events with data for the current cgroup, and not any subtrees. This is legacy behaviour, the default behaviour without this option is to include subtree counts. This option is system wide and can only be set on mount or modified through remount from the init namespace. The mount option is ignored on non-init namespace mounts. memory_recursiveprot Recursively apply memory.min and memory.low protection to entire subtrees, without requiring explicit downward propagation into leaf cgroups. This allows protecting entire subtrees from one another, while retaining free competition within those subtrees. This should have been the default behavior but is a mount-option to avoid regressing setups relying on the original semantics (e.g. specifying bogusly high 'bypass' protection values at higher tree levels). memory_hugetlb_accounting Count HugeTLB memory usage towards the cgroup's overall memory usage for the memory controller (for the purpose of statistics reporting and memory protetion). This is a new behavior that could regress existing setups, so it must be explicitly opted in with this mount option. A few caveats to keep in mind: * There is no HugeTLB pool management involved in the memory controller. The pre-allocated pool does not belong to anyone. Specifically, when a new HugeTLB folio is allocated to the pool, it is not accounted for from the perspective of the memory controller. It is only charged to a cgroup when it is actually used (for e.g at page fault time). Host memory overcommit management has to consider this when configuring hard limits. In general, HugeTLB pool management should be done via other mechanisms (such as the HugeTLB controller). * Failure to charge a HugeTLB folio to the memory controller results in SIGBUS. This could happen even if the HugeTLB pool still has pages available (but the cgroup limit is hit and reclaim attempt fails). * Charging HugeTLB memory towards the memory controller affects memory protection and reclaim dynamics. Any userspace tuning (of low, min limits for e.g) needs to take this into account. * HugeTLB pages utilized while this option is not selected will not be tracked by the memory controller (even if cgroup v2 is remounted later on). pids_localevents The option restores v1-like behavior of pids.events:max, that is only local (inside cgroup proper) fork failures are counted. Without this option pids.events.max represents any pids.max enforcemnt across cgroup's subtree. h]hdefinition_list)}(hhh](hdefinition_list_item)}(hXnsdelegate Consider cgroup namespaces as delegation boundaries. This option is system wide and can only be set on mount or modified through remount from the init namespace. The mount option is ignored on non-init namespace mounts. Please refer to the Delegation section for details. h](hterm)}(h nsdelegateh]h nsdelegate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubh definition)}(hhh]h)}(hXConsider cgroup namespaces as delegation boundaries. This option is system wide and can only be set on mount or modified through remount from the init namespace. The mount option is ignored on non-init namespace mounts. Please refer to the Delegation section for details.h]hXConsider cgroup namespaces as delegation boundaries. This option is system wide and can only be set on mount or modified through remount from the init namespace. The mount option is ignored on non-init namespace mounts. Please refer to the Delegation section for details.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hXSfavordynmods Reduce the latencies of dynamic cgroup modifications such as task migrations and controller on/offs at the cost of making hot path operations such as forks and exits more expensive. The static usage pattern of creating a cgroup, enabling controllers, and then seeding it with CLONE_INTO_CGROUP is not affected by this option. h](j)}(h favordynmodsh]h favordynmods}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hhh]h)}(hXEReduce the latencies of dynamic cgroup modifications such as task migrations and controller on/offs at the cost of making hot path operations such as forks and exits more expensive. The static usage pattern of creating a cgroup, enabling controllers, and then seeding it with CLONE_INTO_CGROUP is not affected by this option.h]hXEReduce the latencies of dynamic cgroup modifications such as task migrations and controller on/offs at the cost of making hot path operations such as forks and exits more expensive. The static usage pattern of creating a cgroup, enabling controllers, and then seeding it with CLONE_INTO_CGROUP is not affected by this option.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hXpmemory_localevents Only populate memory.events with data for the current cgroup, and not any subtrees. This is legacy behaviour, the default behaviour without this option is to include subtree counts. This option is system wide and can only be set on mount or modified through remount from the init namespace. The mount option is ignored on non-init namespace mounts. h](j)}(hmemory_localeventsh]hmemory_localevents}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hhh]h)}(hX\Only populate memory.events with data for the current cgroup, and not any subtrees. This is legacy behaviour, the default behaviour without this option is to include subtree counts. This option is system wide and can only be set on mount or modified through remount from the init namespace. The mount option is ignored on non-init namespace mounts.h]hX\Only populate memory.events with data for the current cgroup, and not any subtrees. This is legacy behaviour, the default behaviour without this option is to include subtree counts. This option is system wide and can only be set on mount or modified through remount from the init namespace. The mount option is ignored on non-init namespace mounts.}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj,ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hXmemory_recursiveprot Recursively apply memory.min and memory.low protection to entire subtrees, without requiring explicit downward propagation into leaf cgroups. This allows protecting entire subtrees from one another, while retaining free competition within those subtrees. This should have been the default behavior but is a mount-option to avoid regressing setups relying on the original semantics (e.g. specifying bogusly high 'bypass' protection values at higher tree levels). h](j)}(hmemory_recursiveproth]hmemory_recursiveprot}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjIubj)}(hhh]h)}(hXRecursively apply memory.min and memory.low protection to entire subtrees, without requiring explicit downward propagation into leaf cgroups. This allows protecting entire subtrees from one another, while retaining free competition within those subtrees. This should have been the default behavior but is a mount-option to avoid regressing setups relying on the original semantics (e.g. specifying bogusly high 'bypass' protection values at higher tree levels).h]hXRecursively apply memory.min and memory.low protection to entire subtrees, without requiring explicit downward propagation into leaf cgroups. This allows protecting entire subtrees from one another, while retaining free competition within those subtrees. This should have been the default behavior but is a mount-option to avoid regressing setups relying on the original semantics (e.g. specifying bogusly high ‘bypass’ protection values at higher tree levels).}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj[ubah}(h]h ]h"]h$]h&]uh1jhjIubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hXmemory_hugetlb_accounting Count HugeTLB memory usage towards the cgroup's overall memory usage for the memory controller (for the purpose of statistics reporting and memory protetion). This is a new behavior that could regress existing setups, so it must be explicitly opted in with this mount option. A few caveats to keep in mind: * There is no HugeTLB pool management involved in the memory controller. The pre-allocated pool does not belong to anyone. Specifically, when a new HugeTLB folio is allocated to the pool, it is not accounted for from the perspective of the memory controller. It is only charged to a cgroup when it is actually used (for e.g at page fault time). Host memory overcommit management has to consider this when configuring hard limits. In general, HugeTLB pool management should be done via other mechanisms (such as the HugeTLB controller). * Failure to charge a HugeTLB folio to the memory controller results in SIGBUS. This could happen even if the HugeTLB pool still has pages available (but the cgroup limit is hit and reclaim attempt fails). * Charging HugeTLB memory towards the memory controller affects memory protection and reclaim dynamics. Any userspace tuning (of low, min limits for e.g) needs to take this into account. * HugeTLB pages utilized while this option is not selected will not be tracked by the memory controller (even if cgroup v2 is remounted later on). h](j)}(hmemory_hugetlb_accountingh]hmemory_hugetlb_accounting}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjxubj)}(hhh](h)}(hXCount HugeTLB memory usage towards the cgroup's overall memory usage for the memory controller (for the purpose of statistics reporting and memory protetion). This is a new behavior that could regress existing setups, so it must be explicitly opted in with this mount option.h]hXCount HugeTLB memory usage towards the cgroup’s overall memory usage for the memory controller (for the purpose of statistics reporting and memory protetion). This is a new behavior that could regress existing setups, so it must be explicitly opted in with this mount option.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hA few caveats to keep in mind:h]hA few caveats to keep in mind:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh bullet_list)}(hhh](h list_item)}(hXThere is no HugeTLB pool management involved in the memory controller. The pre-allocated pool does not belong to anyone. Specifically, when a new HugeTLB folio is allocated to the pool, it is not accounted for from the perspective of the memory controller. It is only charged to a cgroup when it is actually used (for e.g at page fault time). Host memory overcommit management has to consider this when configuring hard limits. In general, HugeTLB pool management should be done via other mechanisms (such as the HugeTLB controller).h]h)}(hXThere is no HugeTLB pool management involved in the memory controller. The pre-allocated pool does not belong to anyone. Specifically, when a new HugeTLB folio is allocated to the pool, it is not accounted for from the perspective of the memory controller. It is only charged to a cgroup when it is actually used (for e.g at page fault time). Host memory overcommit management has to consider this when configuring hard limits. In general, HugeTLB pool management should be done via other mechanisms (such as the HugeTLB controller).h]hXThere is no HugeTLB pool management involved in the memory controller. The pre-allocated pool does not belong to anyone. Specifically, when a new HugeTLB folio is allocated to the pool, it is not accounted for from the perspective of the memory controller. It is only charged to a cgroup when it is actually used (for e.g at page fault time). Host memory overcommit management has to consider this when configuring hard limits. In general, HugeTLB pool management should be done via other mechanisms (such as the HugeTLB controller).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hFailure to charge a HugeTLB folio to the memory controller results in SIGBUS. This could happen even if the HugeTLB pool still has pages available (but the cgroup limit is hit and reclaim attempt fails).h]h)}(hFailure to charge a HugeTLB folio to the memory controller results in SIGBUS. This could happen even if the HugeTLB pool still has pages available (but the cgroup limit is hit and reclaim attempt fails).h]hFailure to charge a HugeTLB folio to the memory controller results in SIGBUS. This could happen even if the HugeTLB pool still has pages available (but the cgroup limit is hit and reclaim attempt fails).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hCharging HugeTLB memory towards the memory controller affects memory protection and reclaim dynamics. Any userspace tuning (of low, min limits for e.g) needs to take this into account.h]h)}(hCharging HugeTLB memory towards the memory controller affects memory protection and reclaim dynamics. Any userspace tuning (of low, min limits for e.g) needs to take this into account.h]hCharging HugeTLB memory towards the memory controller affects memory protection and reclaim dynamics. Any userspace tuning (of low, min limits for e.g) needs to take this into account.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hHugeTLB pages utilized while this option is not selected will not be tracked by the memory controller (even if cgroup v2 is remounted later on). h]h)}(hHugeTLB pages utilized while this option is not selected will not be tracked by the memory controller (even if cgroup v2 is remounted later on).h]hHugeTLB pages utilized while this option is not selected will not be tracked by the memory controller (even if cgroup v2 is remounted later on).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]bullet*uh1jhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjxubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hpids_localevents The option restores v1-like behavior of pids.events:max, that is only local (inside cgroup proper) fork failures are counted. Without this option pids.events.max represents any pids.max enforcemnt across cgroup's subtree. h](j)}(hpids_localeventsh]hpids_localevents}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj$ubj)}(hhh]h)}(hThe option restores v1-like behavior of pids.events:max, that is only local (inside cgroup proper) fork failures are counted. Without this option pids.events.max represents any pids.max enforcemnt across cgroup's subtree.h]hThe option restores v1-like behavior of pids.events:max, that is only local (inside cgroup proper) fork failures are counted. Without this option pids.events.max represents any pids.max enforcemnt across cgroup’s subtree.}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj6ubah}(h]h ]h"]h$]h&]uh1jhj$ubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhj6hhubeh}(h]mountingah ]h"]mountingah$]h&]uh1hhj%hhhhhKubh)}(hhh](h)}(h Organizing Processes and Threadsh]h Organizing Processes and Threads}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjghhhhhKubh)}(hhh](h)}(h Processesh]h Processes}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjxhhhhhKubh)}(hInitially, only the root cgroup exists to which all processes belong. A child cgroup can be created by creating a sub-directory::h]hInitially, only the root cgroup exists to which all processes belong. A child cgroup can be created by creating a sub-directory:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjxhhubjV)}(h# mkdir $CGROUP_NAMEh]h# mkdir $CGROUP_NAME}hjsbah}(h]h ]h"]h$]h&]jjuh1jUhhhMhjxhhubh)}(hXA given cgroup may have multiple child cgroups forming a tree structure. Each cgroup has a read-writable interface file "cgroup.procs". When read, it lists the PIDs of all processes which belong to the cgroup one-per-line. The PIDs are not ordered and the same PID may show up more than once if the process got moved to another cgroup and then back or the PID got recycled while reading.h]hXA given cgroup may have multiple child cgroups forming a tree structure. Each cgroup has a read-writable interface file “cgroup.procs”. When read, it lists the PIDs of all processes which belong to the cgroup one-per-line. The PIDs are not ordered and the same PID may show up more than once if the process got moved to another cgroup and then back or the PID got recycled while reading.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjxhhubh)}(hXA process can be migrated into a cgroup by writing its PID to the target cgroup's "cgroup.procs" file. Only one process can be migrated on a single write(2) call. If a process is composed of multiple threads, writing the PID of any thread migrates all threads of the process.h]hXA process can be migrated into a cgroup by writing its PID to the target cgroup’s “cgroup.procs” file. Only one process can be migrated on a single write(2) call. If a process is composed of multiple threads, writing the PID of any thread migrates all threads of the process.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjxhhubh)}(hXiWhen a process forks a child process, the new process is born into the cgroup that the forking process belongs to at the time of the operation. After exit, a process stays associated with the cgroup that it belonged to at the time of exit until it's reaped; however, a zombie process does not appear in "cgroup.procs" and thus can't be moved to another cgroup.h]hXqWhen a process forks a child process, the new process is born into the cgroup that the forking process belongs to at the time of the operation. After exit, a process stays associated with the cgroup that it belonged to at the time of exit until it’s reaped; however, a zombie process does not appear in “cgroup.procs” and thus can’t be moved to another cgroup.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjxhhubh)}(hA cgroup which doesn't have any children or live processes can be destroyed by removing the directory. Note that a cgroup which doesn't have any children and is associated only with zombie processes is considered empty and can be removed::h]hA cgroup which doesn’t have any children or live processes can be destroyed by removing the directory. Note that a cgroup which doesn’t have any children and is associated only with zombie processes is considered empty and can be removed:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjxhhubjV)}(h# rmdir $CGROUP_NAMEh]h# rmdir $CGROUP_NAME}hjsbah}(h]h ]h"]h$]h&]jjuh1jUhhhMhjxhhubh)}(h"/proc/$PID/cgroup" lists a process's cgroup membership. If legacy cgroup is in use in the system, this file may contain multiple lines, one for each hierarchy. The entry for cgroup v2 is always in the format "0::$PATH"::h]h“/proc/$PID/cgroup” lists a process’s cgroup membership. If legacy cgroup is in use in the system, this file may contain multiple lines, one for each hierarchy. The entry for cgroup v2 is always in the format “0::$PATH”:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM!hjxhhubjV)}(h=# cat /proc/842/cgroup ... 0::/test-cgroup/test-cgroup-nestedh]h=# cat /proc/842/cgroup ... 0::/test-cgroup/test-cgroup-nested}hjsbah}(h]h ]h"]h$]h&]jjuh1jUhhhM&hjxhhubh)}(hIf the process becomes a zombie and the cgroup it was associated with is removed subsequently, " (deleted)" is appended to the path::h]hIf the process becomes a zombie and the cgroup it was associated with is removed subsequently, “ (deleted)” is appended to the path:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM*hjxhhubjV)}(hG# cat /proc/842/cgroup ... 0::/test-cgroup/test-cgroup-nested (deleted)h]hG# cat /proc/842/cgroup ... 0::/test-cgroup/test-cgroup-nested (deleted)}hjsbah}(h]h ]h"]h$]h&]jjuh1jUhhhM-hjxhhubeh}(h] processesah ]h"] processesah$]h&]uh1hhjghhhhhKubh)}(hhh](h)}(hThreadsh]hThreads}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+hhhhhM3ubh)}(hXcgroup v2 supports thread granularity for a subset of controllers to support use cases requiring hierarchical resource distribution across the threads of a group of processes. By default, all threads of a process belong to the same cgroup, which also serves as the resource domain to host resource consumptions which are not specific to a process or thread. The thread mode allows threads to be spread across a subtree while still maintaining the common resource domain for them.h]hXcgroup v2 supports thread granularity for a subset of controllers to support use cases requiring hierarchical resource distribution across the threads of a group of processes. By default, all threads of a process belong to the same cgroup, which also serves as the resource domain to host resource consumptions which are not specific to a process or thread. The thread mode allows threads to be spread across a subtree while still maintaining the common resource domain for them.}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM5hj+hhubh)}(hzControllers which support thread mode are called threaded controllers. The ones which don't are called domain controllers.h]h|Controllers which support thread mode are called threaded controllers. The ones which don’t are called domain controllers.}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM=hj+hhubh)}(hXMarking a cgroup threaded makes it join the resource domain of its parent as a threaded cgroup. The parent may be another threaded cgroup whose resource domain is further up in the hierarchy. The root of a threaded subtree, that is, the nearest ancestor which is not threaded, is called threaded domain or thread root interchangeably and serves as the resource domain for the entire subtree.h]hXMarking a cgroup threaded makes it join the resource domain of its parent as a threaded cgroup. The parent may be another threaded cgroup whose resource domain is further up in the hierarchy. The root of a threaded subtree, that is, the nearest ancestor which is not threaded, is called threaded domain or thread root interchangeably and serves as the resource domain for the entire subtree.}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM@hj+hhubh)}(hInside a threaded subtree, threads of a process can be put in different cgroups and are not subject to the no internal process constraint - threaded controllers can be enabled on non-leaf cgroups whether they have threads in them or not.h]hInside a threaded subtree, threads of a process can be put in different cgroups and are not subject to the no internal process constraint - threaded controllers can be enabled on non-leaf cgroups whether they have threads in them or not.}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMGhj+hhubh)}(hXAs the threaded domain cgroup hosts all the domain resource consumptions of the subtree, it is considered to have internal resource consumptions whether there are processes in it or not and can't have populated child cgroups which aren't threaded. Because the root cgroup is not subject to no internal process constraint, it can serve both as a threaded domain and a parent to domain cgroups.h]hXAs the threaded domain cgroup hosts all the domain resource consumptions of the subtree, it is considered to have internal resource consumptions whether there are processes in it or not and can’t have populated child cgroups which aren’t threaded. Because the root cgroup is not subject to no internal process constraint, it can serve both as a threaded domain and a parent to domain cgroups.}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMLhj+hhubh)}(hThe current operation mode or type of the cgroup is shown in the "cgroup.type" file which indicates whether the cgroup is a normal domain, a domain which is serving as the domain of a threaded subtree, or a threaded cgroup.h]hThe current operation mode or type of the cgroup is shown in the “cgroup.type” file which indicates whether the cgroup is a normal domain, a domain which is serving as the domain of a threaded subtree, or a threaded cgroup.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMShj+hhubh)}(hOn creation, a cgroup is always a domain cgroup and can be made threaded by writing "threaded" to the "cgroup.type" file. The operation is single direction::h]hOn creation, a cgroup is always a domain cgroup and can be made threaded by writing “threaded” to the “cgroup.type” file. The operation is single direction:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMXhj+hhubjV)}(h# echo threaded > cgroup.typeh]h# echo threaded > cgroup.type}hjsbah}(h]h ]h"]h$]h&]jjuh1jUhhhM\hj+hhubh)}(hyOnce threaded, the cgroup can't be made a domain again. To enable the thread mode, the following conditions must be met.h]h{Once threaded, the cgroup can’t be made a domain again. To enable the thread mode, the following conditions must be met.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM^hj+hhubj)}(hhh](j)}(hAs the cgroup will join the parent's resource domain. The parent must either be a valid (threaded) domain or a threaded cgroup. h]h)}(hAs the cgroup will join the parent's resource domain. The parent must either be a valid (threaded) domain or a threaded cgroup.h]hAs the cgroup will join the parent’s resource domain. The parent must either be a valid (threaded) domain or a threaded cgroup.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMahjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hWhen the parent is an unthreaded domain, it must not have any domain controllers enabled or populated domain children. The root is exempt from this requirement. h]h)}(hWhen the parent is an unthreaded domain, it must not have any domain controllers enabled or populated domain children. The root is exempt from this requirement.h]hWhen the parent is an unthreaded domain, it must not have any domain controllers enabled or populated domain children. The root is exempt from this requirement.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMdhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]j-uh1jhhhMahj+hhubh)}(h]Topology-wise, a cgroup can be in an invalid state. Please consider the following topology::h]h\Topology-wise, a cgroup can be in an invalid state. Please consider the following topology:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhhj+hhubjV)}(h=A (threaded domain) - B (threaded) - C (domain, just created)h]h=A (threaded domain) - B (threaded) - C (domain, just created)}hjsbah}(h]h ]h"]h$]h&]jjuh1jUhhhMkhj+hhubh)}(hX!C is created as a domain but isn't connected to a parent which can host child domains. C can't be used until it is turned into a threaded cgroup. "cgroup.type" file will report "domain (invalid)" in these cases. Operations which fail due to invalid topology use EOPNOTSUPP as the errno.h]hX-C is created as a domain but isn’t connected to a parent which can host child domains. C can’t be used until it is turned into a threaded cgroup. “cgroup.type” file will report “domain (invalid)” in these cases. Operations which fail due to invalid topology use EOPNOTSUPP as the errno.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMmhj+hhubh)}(hXA domain cgroup is turned into a threaded domain when one of its child cgroup becomes threaded or threaded controllers are enabled in the "cgroup.subtree_control" file while there are processes in the cgroup. A threaded domain reverts to a normal domain when the conditions clear.h]hXA domain cgroup is turned into a threaded domain when one of its child cgroup becomes threaded or threaded controllers are enabled in the “cgroup.subtree_control” file while there are processes in the cgroup. A threaded domain reverts to a normal domain when the conditions clear.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMshj+hhubh)}(hXWhen read, "cgroup.threads" contains the list of the thread IDs of all threads in the cgroup. Except that the operations are per-thread instead of per-process, "cgroup.threads" has the same format and behaves the same way as "cgroup.procs". While "cgroup.threads" can be written to in any cgroup, as it can only move threads inside the same threaded domain, its operations are confined inside each threaded subtree.h]hXWhen read, “cgroup.threads” contains the list of the thread IDs of all threads in the cgroup. Except that the operations are per-thread instead of per-process, “cgroup.threads” has the same format and behaves the same way as “cgroup.procs”. While “cgroup.threads” can be written to in any cgroup, as it can only move threads inside the same threaded domain, its operations are confined inside each threaded subtree.}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMyhj+hhubh)}(hXThe threaded domain cgroup serves as the resource domain for the whole subtree, and, while the threads can be scattered across the subtree, all the processes are considered to be in the threaded domain cgroup. "cgroup.procs" in a threaded domain cgroup contains the PIDs of all processes in the subtree and is not readable in the subtree proper. However, "cgroup.procs" can be written to from anywhere in the subtree to migrate all threads of the matching process to the cgroup.h]hXThe threaded domain cgroup serves as the resource domain for the whole subtree, and, while the threads can be scattered across the subtree, all the processes are considered to be in the threaded domain cgroup. “cgroup.procs” in a threaded domain cgroup contains the PIDs of all processes in the subtree and is not readable in the subtree proper. However, “cgroup.procs” can be written to from anywhere in the subtree to migrate all threads of the matching process to the cgroup.}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+hhubh)}(hXWOnly threaded controllers can be enabled in a threaded subtree. When a threaded controller is enabled inside a threaded subtree, it only accounts for and controls resource consumptions associated with the threads in the cgroup and its descendants. All consumptions which aren't tied to a specific thread belong to the threaded domain cgroup.h]hXYOnly threaded controllers can be enabled in a threaded subtree. When a threaded controller is enabled inside a threaded subtree, it only accounts for and controls resource consumptions associated with the threads in the cgroup and its descendants. All consumptions which aren’t tied to a specific thread belong to the threaded domain cgroup.}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+hhubh)}(hXBecause a threaded subtree is exempt from no internal process constraint, a threaded controller must be able to handle competition between threads in a non-leaf cgroup and its child cgroups. Each threaded controller defines how such competitions are handled.h]hXBecause a threaded subtree is exempt from no internal process constraint, a threaded controller must be able to handle competition between threads in a non-leaf cgroup and its child cgroups. Each threaded controller defines how such competitions are handled.}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+hhubh)}(h[Currently, the following controllers are threaded and can be enabled in a threaded cgroup::h]hZCurrently, the following controllers are threaded and can be enabled in a threaded cgroup:}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+hhubjV)}(h"- cpu - cpuset - perf_event - pidsh]h"- cpu - cpuset - perf_event - pids}hjrsbah}(h]h ]h"]h$]h&]jjuh1jUhhhMhj+hhubeh}(h]threadsah ]h"]threadsah$]h&]uh1hhjghhhhhM3ubeh}(h] organizing-processes-and-threadsah ]h"] organizing processes and threadsah$]h&]uh1hhj%hhhhhKubh)}(hhh](h)}(h[Un]populated Notificationh]h[Un]populated Notification}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hXlEach non-root cgroup has a "cgroup.events" file which contains "populated" field indicating whether the cgroup's sub-hierarchy has live processes in it. Its value is 0 if there is no live process in the cgroup and its descendants; otherwise, 1. poll and [id]notify events are triggered when the value changes. This can be used, for example, to start a clean-up operation after all processes of a given sub-hierarchy have exited. The populated state updates and notifications are recursive. Consider the following sub-hierarchy where the numbers in the parentheses represent the numbers of processes in each cgroup::h]hXuEach non-root cgroup has a “cgroup.events” file which contains “populated” field indicating whether the cgroup’s sub-hierarchy has live processes in it. Its value is 0 if there is no live process in the cgroup and its descendants; otherwise, 1. poll and [id]notify events are triggered when the value changes. This can be used, for example, to start a clean-up operation after all processes of a given sub-hierarchy have exited. The populated state updates and notifications are recursive. Consider the following sub-hierarchy where the numbers in the parentheses represent the numbers of processes in each cgroup:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjV)}(h%A(4) - B(0) - C(1) \ D(0)h]h%A(4) - B(0) - C(1) \ D(0)}hjsbah}(h]h ]h"]h$]h&]jjuh1jUhhhMhjhhubh)}(hA, B and C's "populated" fields would be 1 while D's 0. After the one process in C exits, B and C's "populated" fields would flip to "0" and file modified events will be generated on the "cgroup.events" files of both cgroups.h]hA, B and C’s “populated” fields would be 1 while D’s 0. After the one process in C exits, B and C’s “populated” fields would flip to “0” and file modified events will be generated on the “cgroup.events” files of both cgroups.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]un-populated-notificationah ]h"][un]populated notificationah$]h&]uh1hhj%hhhhhMubh)}(hhh](h)}(hControlling Controllersh]hControlling Controllers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hEnabling and Disablingh]hEnabling and Disabling}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hlEach cgroup has a "cgroup.controllers" file which lists all controllers available for the cgroup to enable::h]hoEach cgroup has a “cgroup.controllers” file which lists all controllers available for the cgroup to enable:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjV)}(h&# cat cgroup.controllers cpu io memoryh]h&# cat cgroup.controllers cpu io memory}hjsbah}(h]h ]h"]h$]h&]jjuh1jUhhhMhjhhubh)}(hNo controller is enabled by default. Controllers can be enabled and disabled by writing to the "cgroup.subtree_control" file::h]hNo controller is enabled by default. Controllers can be enabled and disabled by writing to the “cgroup.subtree_control” file:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjV)}(h2# echo "+cpu +memory -io" > cgroup.subtree_controlh]h2# echo "+cpu +memory -io" > cgroup.subtree_control}hjsbah}(h]h ]h"]h$]h&]jjuh1jUhhhMhjhhubh)}(hOnly controllers which are listed in "cgroup.controllers" can be enabled. When multiple operations are specified as above, either they all succeed or fail. If multiple operations on the same controller are specified, the last one is effective.h]hOnly controllers which are listed in “cgroup.controllers” can be enabled. When multiple operations are specified as above, either they all succeed or fail. If multiple operations on the same controller are specified, the last one is effective.}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hEnabling 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. The enabled controllers are listed in parentheses::h]hEnabling 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. The enabled controllers are listed in parentheses:}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjV)}(h?A(cpu,memory) - B(memory) - C() \ D()h]h?A(cpu,memory) - B(memory) - C() \ D()}hjIsbah}(h]h ]h"]h$]h&]jjuh1jUhhhMhjhhubh)}(hXAs A has "cpu" and "memory" enabled, A will control the distribution of CPU cycles and memory to its children, in this case, B. As B has "memory" enabled but not "CPU", C and D will compete freely on CPU cycles but their division of memory available to B will be controlled.h]hX#As A has “cpu” and “memory” enabled, A will control the distribution of CPU cycles and memory to its children, in this case, B. As B has “memory” enabled but not “CPU”, C and D will compete freely on CPU cycles but their division of memory available to B will be controlled.}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hX As a controller regulates the distribution of the target resource to the cgroup's children, enabling it creates the controller's interface files in the child cgroups. In the above example, enabling "cpu" on B would create the "cpu." prefixed controller interface files in C and D. Likewise, disabling "memory" from B would remove the "memory." prefixed controller interface files from C and D. This means that the controller interface files - anything which doesn't start with "cgroup." are owned by the parent rather than the cgroup itself.h]hX:As a controller regulates the distribution of the target resource to the cgroup’s children, enabling it creates the controller’s interface files in the child cgroups. In the above example, enabling “cpu” on B would create the “cpu.” prefixed controller interface files in C and D. Likewise, disabling “memory” from B would remove the “memory.” prefixed controller interface files from C and D. This means that the controller interface files - anything which doesn’t start with “cgroup.” are owned by the parent rather than the cgroup itself.}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]enabling-and-disablingah ]h"]enabling and disablingah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hTop-down Constrainth]hTop-down Constraint}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj{hhhhhMubh)}(hXResources are distributed top-down and a cgroup can further distribute a resource only if the resource has been distributed to it from the parent. This means that all non-root "cgroup.subtree_control" files can only contain controllers which are enabled in the parent's "cgroup.subtree_control" file. A controller can be enabled only if the parent has the controller enabled and a controller can't be disabled if one or more children have it enabled.h]hXResources are distributed top-down and a cgroup can further distribute a resource only if the resource has been distributed to it from the parent. This means that all non-root “cgroup.subtree_control” files can only contain controllers which are enabled in the parent’s “cgroup.subtree_control” file. A controller can be enabled only if the parent has the controller enabled and a controller can’t be disabled if one or more children have it enabled.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj{hhubeh}(h]top-down-constraintah ]h"]top-down constraintah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hNo Internal Process Constrainth]hNo Internal Process Constraint}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hX Non-root cgroups can distribute domain resources to their children only when they don't have any processes of their own. In other words, only domain cgroups which don't contain any processes can have domain controllers enabled in their "cgroup.subtree_control" files.h]hXNon-root cgroups can distribute domain resources to their children only when they don’t have any processes of their own. In other words, only domain cgroups which don’t contain any processes can have domain controllers enabled in their “cgroup.subtree_control” files.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hThis guarantees that, when a domain controller is looking at the part of the hierarchy which has it enabled, processes are always only on the leaves. This rules out situations where child cgroups compete against internal processes of the parent.h]hThis guarantees that, when a domain controller is looking at the part of the hierarchy which has it enabled, processes are always only on the leaves. This rules out situations where child cgroups compete against internal processes of the parent.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hXThe root cgroup is exempt from this restriction. Root contains processes and anonymous resource consumption which can't be associated with any other cgroups and requires special treatment from most controllers. How resource consumption in the root cgroup is governed is up to each controller (for more information on this topic please refer to the Non-normative information section in the Controllers chapter).h]hXThe root cgroup is exempt from this restriction. Root contains processes and anonymous resource consumption which can’t be associated with any other cgroups and requires special treatment from most controllers. How resource consumption in the root cgroup is governed is up to each controller (for more information on this topic please refer to the Non-normative information section in the Controllers chapter).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hXNote that the restriction doesn't get in the way if there is no enabled controller in the cgroup's "cgroup.subtree_control". This is important as otherwise it wouldn't be possible to create children of a populated cgroup. To control resource distribution of a cgroup, the cgroup must create children and transfer all its processes to the children before enabling controllers in its "cgroup.subtree_control" file.h]hXNote that the restriction doesn’t get in the way if there is no enabled controller in the cgroup’s “cgroup.subtree_control”. This is important as otherwise it wouldn’t be possible to create children of a populated cgroup. To control resource distribution of a cgroup, the cgroup must create children and transfer all its processes to the children before enabling controllers in its “cgroup.subtree_control” file.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]no-internal-process-constraintah ]h"]no internal process constraintah$]h&]uh1hhjhhhhhMubeh}(h]controlling-controllersah ]h"]controlling controllersah$]h&]uh1hhj%hhhhhMubh)}(hhh](h)}(h Delegationh]h Delegation}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM ubh)}(hhh](h)}(hModel of Delegationh]hModel of Delegation}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hX7A cgroup can be delegated in two ways. First, to a less privileged user by granting write access of the directory and its "cgroup.procs", "cgroup.threads" and "cgroup.subtree_control" files to the user. Second, if the "nsdelegate" mount option is set, automatically to a cgroup namespace on namespace creation.h]hXGA cgroup can be delegated in two ways. First, to a less privileged user by granting write access of the directory and its “cgroup.procs”, “cgroup.threads” and “cgroup.subtree_control” files to the user. Second, if the “nsdelegate” mount option is set, automatically to a cgroup namespace on namespace creation.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hXdBecause the resource control interface files in a given directory control the distribution of the parent's resources, the delegatee shouldn't be allowed to write to them. For the first method, this is achieved by not granting access to these files. For the second, files outside the namespace should be hidden from the delegatee by the means of at least mount namespacing, and the kernel rejects writes to all files on a namespace root from inside the cgroup namespace, except for those files listed in "/sys/kernel/cgroup/delegate" (including "cgroup.procs", "cgroup.threads", "cgroup.subtree_control", etc.).h]hXxBecause the resource control interface files in a given directory control the distribution of the parent’s resources, the delegatee shouldn’t be allowed to write to them. For the first method, this is achieved by not granting access to these files. For the second, files outside the namespace should be hidden from the delegatee by the means of at least mount namespacing, and the kernel rejects writes to all files on a namespace root from inside the cgroup namespace, except for those files listed in “/sys/kernel/cgroup/delegate” (including “cgroup.procs”, “cgroup.threads”, “cgroup.subtree_control”, etc.).}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hXThe end results are equivalent for both delegation types. Once delegated, the user can build sub-hierarchy under the directory, organize processes inside it as it sees fit and further distribute the resources it received from the parent. The limits and other settings of all resource controllers are hierarchical and regardless of what happens in the delegated sub-hierarchy, nothing can escape the resource restrictions imposed by the parent.h]hXThe end results are equivalent for both delegation types. Once delegated, the user can build sub-hierarchy under the directory, organize processes inside it as it sees fit and further distribute the resources it received from the parent. The limits and other settings of all resource controllers are hierarchical and regardless of what happens in the delegated sub-hierarchy, nothing can escape the resource restrictions imposed by the parent.}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj hhubh)}(hCurrently, cgroup doesn't impose any restrictions on the number of cgroups in or nesting depth of a delegated sub-hierarchy; however, this may be limited explicitly in the future.h]hCurrently, cgroup doesn’t impose any restrictions on the number of cgroups in or nesting depth of a delegated sub-hierarchy; however, this may be limited explicitly in the future.}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM(hj hhubeh}(h]model-of-delegationah ]h"]model of delegationah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hDelegation Containmenth]hDelegation Containment}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj]hhhhhM.ubh)}(hA delegated sub-hierarchy is contained in the sense that processes can't be moved into or out of the sub-hierarchy by the delegatee.h]hA delegated sub-hierarchy is contained in the sense that processes can’t be moved into or out of the sub-hierarchy by the delegatee.}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM0hj]hhubh)}(hFor delegations to a less privileged user, this is achieved by requiring the following conditions for a process with a non-root euid to migrate a target process into a cgroup by writing its PID to the "cgroup.procs" file.h]hFor delegations to a less privileged user, this is achieved by requiring the following conditions for a process with a non-root euid to migrate a target process into a cgroup by writing its PID to the “cgroup.procs” file.}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM3hj]hhubj)}(hhh](j)}(h>The writer must have write access to the "cgroup.procs" file. h]h)}(h=The writer must have write access to the "cgroup.procs" file.h]hAThe writer must have write access to the “cgroup.procs” file.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM8hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h{The writer must have write access to the "cgroup.procs" file of the common ancestor of the source and destination cgroups. h]h)}(hzThe writer must have write access to the "cgroup.procs" file of the common ancestor of the source and destination cgroups.h]h~The writer must have write access to the “cgroup.procs” file of the common ancestor of the source and destination cgroups.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM:hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhM8hj]hhubh)}(hThe above two constraints ensure that while a delegatee may migrate processes around freely in the delegated sub-hierarchy it can't pull in from or push out to outside the sub-hierarchy.h]hThe above two constraints ensure that while a delegatee may migrate processes around freely in the delegated sub-hierarchy it can’t pull in from or push out to outside the sub-hierarchy.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM=hj]hhubh)}(hFor an example, let's assume cgroups C0 and C1 have been delegated to user U0 who created C00, C01 under C0 and C10 under C1 as follows and all processes under C0 and C1 belong to U0::h]hFor an example, let’s assume cgroups C0 and C1 have been delegated to user U0 who created C00, C01 under C0 and C10 under C1 as follows and all processes under C0 and C1 belong to U0:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMAhj]hhubjV)}(hX~~~~~~~~~~~~~ - C0 - C00 ~ cgroup ~ \ C01 ~ hierarchy ~ ~~~~~~~~~~~~~ - C1 - C10h]hX~~~~~~~~~~~~~ - C0 - C00 ~ cgroup ~ \ C01 ~ hierarchy ~ ~~~~~~~~~~~~~ - C1 - C10}hjsbah}(h]h ]h"]h$]h&]jjuh1jUhhhMEhj]hhubh)}(hXpLet's also say U0 wants to write the PID of a process which is currently in C10 into "C00/cgroup.procs". U0 has write access to the file; however, the common ancestor of the source cgroup C10 and the destination cgroup C00 is above the points of delegation and U0 would not have write access to its "cgroup.procs" files and thus the write will be denied with -EACCES.h]hXzLet’s also say U0 wants to write the PID of a process which is currently in C10 into “C00/cgroup.procs”. U0 has write access to the file; however, the common ancestor of the source cgroup C10 and the destination cgroup C00 is above the points of delegation and U0 would not have write access to its “cgroup.procs” files and thus the write will be denied with -EACCES.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMJhj]hhubh)}(hXFor delegations to namespaces, containment is achieved by requiring that both the source and destination cgroups are reachable from the namespace of the process which is attempting the migration. If either is not reachable, the migration is rejected with -ENOENT.h]hXFor delegations to namespaces, containment is achieved by requiring that both the source and destination cgroups are reachable from the namespace of the process which is attempting the migration. If either is not reachable, the migration is rejected with -ENOENT.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMQhj]hhubeh}(h]delegation-containmentah ]h"]delegation containmentah$]h&]uh1hhjhhhhhM.ubeh}(h] delegationah ]h"] delegationah$]h&]uh1hhj%hhhhhM ubh)}(hhh](h)}(h Guidelinesh]h Guidelines}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMXubh)}(hhh](h)}(hOrganize Once and Controlh]hOrganize Once and Control}(hj- hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj* hhhhhM[ubh)}(hX-Migrating a process across cgroups is a relatively expensive operation and stateful resources such as memory are not moved together with the process. This is an explicit design decision as there often exist inherent trade-offs between migration and various hot paths in terms of synchronization cost.h]hX-Migrating a process across cgroups is a relatively expensive operation and stateful resources such as memory are not moved together with the process. This is an explicit design decision as there often exist inherent trade-offs between migration and various hot paths in terms of synchronization cost.}(hj; hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM]hj* hhubh)}(hXlAs such, migrating processes across cgroups frequently as a means to apply different resource restrictions is discouraged. A workload should be assigned to a cgroup according to the system's logical and resource structure once on start-up. Dynamic adjustments to resource distribution can be made by changing controller configuration through the interface files.h]hXnAs such, migrating processes across cgroups frequently as a means to apply different resource restrictions is discouraged. A workload should be assigned to a cgroup according to the system’s logical and resource structure once on start-up. Dynamic adjustments to resource distribution can be made by changing controller configuration through the interface files.}(hjI hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMchj* hhubeh}(h]organize-once-and-controlah ]h"]organize once and controlah$]h&]uh1hhj hhhhhM[ubh)}(hhh](h)}(hAvoid Name Collisionsh]hAvoid Name Collisions}(hjb hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj_ hhhhhMlubh)}(hInterface files for a cgroup and its children cgroups occupy the same directory and it is possible to create children cgroups which collide with interface files.h]hInterface files for a cgroup and its children cgroups occupy the same directory and it is possible to create children cgroups which collide with interface files.}(hjp hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMnhj_ hhubh)}(hXAll cgroup core interface files are prefixed with "cgroup." and each controller's interface files are prefixed with the controller name and a dot. A controller's name is composed of lower case alphabets and '_'s but never begins with an '_' so it can be used as the prefix character for collision avoidance. Also, interface file names won't start or end with terms which are often used in categorizing workloads such as job, service, slice, unit or workload.h]hXAll cgroup core interface files are prefixed with “cgroup.” and each controller’s interface files are prefixed with the controller name and a dot. A controller’s name is composed of lower case alphabets and ‘_’s but never begins with an ‘_’ so it can be used as the prefix character for collision avoidance. Also, interface file names won’t start or end with terms which are often used in categorizing workloads such as job, service, slice, unit or workload.}(hj~ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMrhj_ hhubh)}(hgcgroup doesn't do anything to prevent name collisions and it's the user's responsibility to avoid them.h]hmcgroup doesn’t do anything to prevent name collisions and it’s the user’s responsibility to avoid them.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMzhj_ hhubeh}(h]avoid-name-collisionsah ]h"]avoid name collisionsah$]h&]uh1hhj hhhhhMlubeh}(h] guidelinesah ]h"] guidelinesah$]h&]uh1hhj%hhhhhMXubeh}(h]basic-operationsah ]h"]basic operationsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hResource Distribution Modelsh]hResource Distribution Models}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hcgroup controllers implement several resource distribution schemes depending on the resource type and expected use cases. This section describes major schemes in use along with their expected behaviors.h]hcgroup controllers implement several resource distribution schemes depending on the resource type and expected use cases. This section describes major schemes in use along with their expected behaviors.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hhh](h)}(hWeightsh]hWeights}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hXnA parent's resource is distributed by adding up the weights of all active children and giving each the fraction matching the ratio of its weight against the sum. As only children which can make use of the resource at the moment participate in the distribution, this is work-conserving. Due to the dynamic nature, this model is usually used for stateless resources.h]hXpA parent’s resource is distributed by adding up the weights of all active children and giving each the fraction matching the ratio of its weight against the sum. As only children which can make use of the resource at the moment participate in the distribution, this is work-conserving. Due to the dynamic nature, this model is usually used for stateless resources.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hAll weights are in the range [1, 10000] with the default at 100. This allows symmetric multiplicative biases in both directions at fine enough granularity while staying in the intuitive range.h]hAll weights are in the range [1, 10000] with the default at 100. This allows symmetric multiplicative biases in both directions at fine enough granularity while staying in the intuitive range.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hAs long as the weight is in range, all configuration combinations are valid and there is no reason to reject configuration changes or process migrations.h]hAs long as the weight is in range, all configuration combinations are valid and there is no reason to reject configuration changes or process migrations.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(he"cpu.weight" proportionally distributes CPU cycles to active children and is an example of this type.h]hi“cpu.weight” proportionally distributes CPU cycles to active children and is an example of this type.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(h .. _cgroupv2-limits-distributor:h]h}(h]h ]h"]h$]h&]hcgroupv2-limits-distributoruh1hhMhj hhhhubeh}(h]weightsah ]h"]weightsah$]h&]uh1hhj hhhhhMubh)}(hhh](h)}(hLimitsh]hLimits}(hj0 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj- hhhhhMubh)}(hA child can only consume up to the configured amount of the resource. Limits can be over-committed - the sum of the limits of children can exceed the amount of resource available to the parent.h]hA child can only consume up to the configured amount of the resource. Limits can be over-committed - the sum of the limits of children can exceed the amount of resource available to the parent.}(hj> hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj- hhubh)}(hFLimits are in the range [0, max] and defaults to "max", which is noop.h]hJLimits are in the range [0, max] and defaults to “max”, which is noop.}(hjL hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj- hhubh)}(hAs limits can be over-committed, all configuration combinations are valid and there is no reason to reject configuration changes or process migrations.h]hAs limits can be over-committed, all configuration combinations are valid and there is no reason to reject configuration changes or process migrations.}(hjZ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj- hhubh)}(hu"io.max" limits the maximum BPS and/or IOPS that a cgroup can consume on an IO device and is an example of this type.h]hy“io.max” limits the maximum BPS and/or IOPS that a cgroup can consume on an IO device and is an example of this type.}(hjh hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj- hhubh)}(h%.. _cgroupv2-protections-distributor:h]h}(h]h ]h"]h$]h&]h cgroupv2-protections-distributoruh1hhMhj- hhhhubeh}(h](limitsj$ eh ]h"](limitscgroupv2-limits-distributoreh$]h&]uh1hhj hhhhhMexpect_referenced_by_name}j j sexpect_referenced_by_id}j$ j subh)}(hhh](h)}(h Protectionsh]h Protections}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hXSA cgroup is protected up to the configured amount of the resource as long as the usages of all its ancestors are under their protected levels. Protections can be hard guarantees or best effort soft boundaries. Protections can also be over-committed in which case only up to the amount available to the parent is protected among children.h]hXSA cgroup is protected up to the configured amount of the resource as long as the usages of all its ancestors are under their protected levels. Protections can be hard guarantees or best effort soft boundaries. Protections can also be over-committed in which case only up to the amount available to the parent is protected among children.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hGProtections are in the range [0, max] and defaults to 0, which is noop.h]hGProtections are in the range [0, max] and defaults to 0, which is noop.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hAs protections can be over-committed, all configuration combinations are valid and there is no reason to reject configuration changes or process migrations.h]hAs protections can be over-committed, all configuration combinations are valid and there is no reason to reject configuration changes or process migrations.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hU"memory.low" implements best-effort memory protection and is an example of this type.h]hY“memory.low” implements best-effort memory protection and is an example of this type.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(h]( protectionsj eh ]h"]( protections cgroupv2-protections-distributoreh$]h&]uh1hhj hhhhhMj }j jv sj }j jv subh)}(hhh](h)}(h Allocationsh]h Allocations}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hA cgroup is exclusively allocated a certain amount of a finite resource. Allocations can't be over-committed - the sum of the allocations of children can not exceed the amount of resource available to the parent.h]hA cgroup is exclusively allocated a certain amount of a finite resource. Allocations can’t be over-committed - the sum of the allocations of children can not exceed the amount of resource available to the parent.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hNAllocations are in the range [0, max] and defaults to 0, which is no resource.h]hNAllocations are in the range [0, max] and defaults to 0, which is no resource.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hAs allocations can't be over-committed, some configuration combinations are invalid and should be rejected. Also, if the resource is mandatory for execution of processes, process migrations may be rejected.h]hAs allocations can’t be over-committed, some configuration combinations are invalid and should be rejected. Also, if the resource is mandatory for execution of processes, process migrations may be rejected.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hK"cpu.rt.max" hard-allocates realtime slices and is an example of this type.h]hO“cpu.rt.max” hard-allocates realtime slices and is an example of this type.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(h] allocationsah ]h"] allocationsah$]h&]uh1hhj hhhhhMubeh}(h]resource-distribution-modelsah ]h"]resource distribution modelsah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hInterface Filesh]hInterface Files}(hj> hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj; hhhhhMubh)}(hhh](h)}(hFormath]hFormat}(hjO hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjL hhhhhMubh)}(hQAll interface files should be in one of the following formats whenever possible::h]hPAll interface files should be in one of the following formats whenever possible:}(hj] hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjL hhubjV)}(hXNew-line separated values (when only one value can be written at once) VAL0\n VAL1\n ... Space separated values (when read-only or multiple values can be written at once) VAL0 VAL1 ...\n Flat keyed KEY0 VAL0\n KEY1 VAL1\n ... Nested keyed KEY0 SUB_KEY0=VAL00 SUB_KEY1=VAL01... KEY1 SUB_KEY0=VAL10 SUB_KEY1=VAL11... ...h]hXNew-line separated values (when only one value can be written at once) VAL0\n VAL1\n ... Space separated values (when read-only or multiple values can be written at once) VAL0 VAL1 ...\n Flat keyed KEY0 VAL0\n KEY1 VAL1\n ... Nested keyed KEY0 SUB_KEY0=VAL00 SUB_KEY1=VAL01... KEY1 SUB_KEY0=VAL10 SUB_KEY1=VAL11... ...}hjk sbah}(h]h ]h"]h$]h&]jjuh1jUhhhMhjL hhubh)}(hFor a writable file, the format for writing should generally match reading; however, controllers may allow omitting later fields or implement restricted shortcuts for most common use cases.h]hFor a writable file, the format for writing should generally match reading; however, controllers may allow omitting later fields or implement restricted shortcuts for most common use cases.}(hjy hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjL hhubh)}(hFor both flat and nested keyed files, only the values for a single key can be written at a time. For nested keyed files, the sub key pairs may be specified in any order and not all pairs have to be specified.h]hFor both flat and nested keyed files, only the values for a single key can be written at a time. For nested keyed files, the sub key pairs may be specified in any order and not all pairs have to be specified.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjL hhubeh}(h]formatah ]h"]formatah$]h&]uh1hhj; hhhhhMubh)}(hhh](h)}(h Conventionsh]h Conventions}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubj)}(hhh](j)}(hDSettings for a single feature should be contained in a single file. h]h)}(hCSettings for a single feature should be contained in a single file.h]hCSettings for a single feature should be contained in a single file.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubj)}(hqThe root cgroup should be exempt from resource control and thus shouldn't have resource control interface files. h]h)}(hpThe root cgroup should be exempt from resource control and thus shouldn't have resource control interface files.h]hrThe root cgroup should be exempt from resource control and thus shouldn’t have resource control interface files.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubj)}(hsThe default time unit is microseconds. If a different unit is ever used, an explicit unit suffix must be present. h]h)}(hrThe default time unit is microseconds. If a different unit is ever used, an explicit unit suffix must be present.h]hrThe default time unit is microseconds. If a different unit is ever used, an explicit unit suffix must be present.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubj)}(hkA parts-per quantity should use a percentage decimal with at least two digit fractional part - e.g. 13.40. h]h)}(hjA parts-per quantity should use a percentage decimal with at least two digit fractional part - e.g. 13.40.h]hjA parts-per quantity should use a percentage decimal with at least two digit fractional part - e.g. 13.40.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubj)}(hX!If a controller implements weight based resource distribution, its interface file should be named "weight" and have the range [1, 10000] with 100 as the default. The values are chosen to allow enough and symmetric bias in both directions while keeping it intuitive (the default is 100%). h]h)}(hX If a controller implements weight based resource distribution, its interface file should be named "weight" and have the range [1, 10000] with 100 as the default. The values are chosen to allow enough and symmetric bias in both directions while keeping it intuitive (the default is 100%).h]hX$If a controller implements weight based resource distribution, its interface file should be named “weight” and have the range [1, 10000] with 100 as the default. The values are chosen to allow enough and symmetric bias in both directions while keeping it intuitive (the default is 100%).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubj)}(hXIf a controller implements an absolute resource guarantee and/or limit, the interface files should be named "min" and "max" respectively. If a controller implements best effort resource guarantee and/or limit, the interface files should be named "low" and "high" respectively. In the above four control files, the special token "max" should be used to represent upward infinity for both reading and writing. h](h)}(hXIf a controller implements an absolute resource guarantee and/or limit, the interface files should be named "min" and "max" respectively. If a controller implements best effort resource guarantee and/or limit, the interface files should be named "low" and "high" respectively.h]hX%If a controller implements an absolute resource guarantee and/or limit, the interface files should be named “min” and “max” respectively. If a controller implements best effort resource guarantee and/or limit, the interface files should be named “low” and “high” respectively.}(hj- hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj) ubh)}(hIn the above four control files, the special token "max" should be used to represent upward infinity for both reading and writing.h]hIn the above four control files, the special token “max” should be used to represent upward infinity for both reading and writing.}(hj; hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj) ubeh}(h]h ]h"]h$]h&]uh1jhj hhhhhNubj)}(hXIf a setting has a configurable default value and keyed specific overrides, the default entry should be keyed with "default" and appear as the first entry in the file. The default value can be updated by writing either "default $VAL" or "$VAL". When writing to update a specific override, "default" can be used as the value to indicate removal of the override. Override entries with "default" as the value must not appear when read. For example, a setting which is keyed by major:minor device numbers with integer values may look like the following:: # cat cgroup-example-interface-file default 150 8:0 300 The default value can be updated by:: # echo 125 > cgroup-example-interface-file or:: # echo "default 125" > cgroup-example-interface-file An override can be set by:: # echo "8:16 170" > cgroup-example-interface-file and cleared by:: # echo "8:0 default" > cgroup-example-interface-file # cat cgroup-example-interface-file default 125 8:16 170 h](h)}(hIf a setting has a configurable default value and keyed specific overrides, the default entry should be keyed with "default" and appear as the first entry in the file.h]hIf a setting has a configurable default value and keyed specific overrides, the default entry should be keyed with “default” and appear as the first entry in the file.}(hjS hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjO ubh)}(hLThe default value can be updated by writing either "default $VAL" or "$VAL".h]hTThe default value can be updated by writing either “default $VAL” or “$VAL”.}(hja hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM$hjO ubh)}(hWhen writing to update a specific override, "default" can be used as the value to indicate removal of the override. Override entries with "default" as the value must not appear when read.h]hWhen writing to update a specific override, “default” can be used as the value to indicate removal of the override. Override entries with “default” as the value must not appear when read.}(hjo hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM'hjO ubh)}(huFor example, a setting which is keyed by major:minor device numbers with integer values may look like the following::h]htFor example, a setting which is keyed by major:minor device numbers with integer values may look like the following:}(hj} hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM+hjO ubjV)}(h7# cat cgroup-example-interface-file default 150 8:0 300h]h7# cat cgroup-example-interface-file default 150 8:0 300}hj sbah}(h]h ]h"]h$]h&]jjuh1jUhhhM.hjO ubh)}(h%The default value can be updated by::h]h$The default value can be updated by:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM2hjO ubjV)}(h*# echo 125 > cgroup-example-interface-fileh]h*# echo 125 > cgroup-example-interface-file}hj sbah}(h]h ]h"]h$]h&]jjuh1jUhhhM4hjO ubh)}(hor::h]hor:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM6hjO ubjV)}(h4# echo "default 125" > cgroup-example-interface-fileh]h4# echo "default 125" > cgroup-example-interface-file}hj sbah}(h]h ]h"]h$]h&]jjuh1jUhhhM8hjO ubh)}(hAn override can be set by::h]hAn override can be set by:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM:hjO ubjV)}(h1# echo "8:16 170" > cgroup-example-interface-fileh]h1# echo "8:16 170" > cgroup-example-interface-file}hj sbah}(h]h ]h"]h$]h&]jjuh1jUhhhM<hjO ubh)}(hand cleared by::h]hand cleared by:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM>hjO ubjV)}(hm# echo "8:0 default" > cgroup-example-interface-file # cat cgroup-example-interface-file default 125 8:16 170h]hm# echo "8:0 default" > cgroup-example-interface-file # cat cgroup-example-interface-file default 125 8:16 170}hj sbah}(h]h ]h"]h$]h&]jjuh1jUhhhM@hjO ubeh}(h]h ]h"]h$]h&]uh1jhj hhhhhNubj)}(hFor events which are not very high frequency, an interface file "events" should be created which lists event key value pairs. Whenever a notifiable event happens, file modified event should be generated on the file. h]h)}(hFor events which are not very high frequency, an interface file "events" should be created which lists event key value pairs. Whenever a notifiable event happens, file modified event should be generated on the file.h]hFor events which are not very high frequency, an interface file “events” should be created which lists event key value pairs. Whenever a notifiable event happens, file modified event should be generated on the file.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMEhj ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhMhj hhubeh}(h] conventionsah ]h"] conventionsah$]h&]uh1hhj; hhhhhMubh)}(hhh](h)}(hCore Interface Filesh]hCore Interface Files}(hj8 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj5 hhhhhMLubh)}(h1All cgroup core files are prefixed with "cgroup."h]h5All cgroup core files are prefixed with “cgroup.”}(hjF hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMNhj5 hhubj)}(hX!cgroup.type A read-write single value file which exists on non-root cgroups. When read, it indicates the current type of the cgroup, which can be one of the following values. - "domain" : A normal valid domain cgroup. - "domain threaded" : A threaded domain cgroup which is serving as the root of a threaded subtree. - "domain invalid" : A cgroup which is in an invalid state. It can't be populated or have controllers enabled. It may be allowed to become a threaded cgroup. - "threaded" : A threaded cgroup which is a member of a threaded subtree. A cgroup can be turned into a threaded cgroup by writing "threaded" to this file. cgroup.procs A read-write new-line separated values file which exists on all cgroups. When read, it lists the PIDs of all processes which belong to the cgroup one-per-line. The PIDs are not ordered and the same PID may show up more than once if the process got moved to another cgroup and then back or the PID got recycled while reading. A PID can be written to migrate the process associated with the PID to the cgroup. The writer should match all of the following conditions. - It must have write access to the "cgroup.procs" file. - It must have write access to the "cgroup.procs" file of the common ancestor of the source and destination cgroups. When delegating a sub-hierarchy, write access to this file should be granted along with the containing directory. In a threaded cgroup, reading this file fails with EOPNOTSUPP as all the processes belong to the thread root. Writing is supported and moves every thread of the process to the cgroup. cgroup.threads A read-write new-line separated values file which exists on all cgroups. When read, it lists the TIDs of all threads which belong to the cgroup one-per-line. The TIDs are not ordered and the same TID may show up more than once if the thread got moved to another cgroup and then back or the TID got recycled while reading. A TID can be written to migrate the thread associated with the TID to the cgroup. The writer should match all of the following conditions. - It must have write access to the "cgroup.threads" file. - The cgroup that the thread is currently in must be in the same resource domain as the destination cgroup. - It must have write access to the "cgroup.procs" file of the common ancestor of the source and destination cgroups. When delegating a sub-hierarchy, write access to this file should be granted along with the containing directory. cgroup.controllers A read-only space separated values file which exists on all cgroups. It shows space separated list of all controllers available to the cgroup. The controllers are not ordered. cgroup.subtree_control A read-write space separated values file which exists on all cgroups. Starts out empty. When read, it shows space separated list of the controllers which are enabled to control resource distribution from the cgroup to its children. Space separated list of controllers prefixed with '+' or '-' can be written to enable or disable controllers. A controller name prefixed with '+' enables the controller and '-' disables. If a controller appears more than once on the list, the last one is effective. When multiple enable and disable operations are specified, either all succeed or all fail. cgroup.events A read-only flat-keyed file which exists on non-root cgroups. The following entries are defined. Unless specified otherwise, a value change in this file generates a file modified event. populated 1 if the cgroup or its descendants contains any live processes; otherwise, 0. frozen 1 if the cgroup is frozen; otherwise, 0. cgroup.max.descendants A read-write single value files. The default is "max". Maximum allowed number of descent cgroups. If the actual number of descendants is equal or larger, an attempt to create a new cgroup in the hierarchy will fail. cgroup.max.depth A read-write single value files. The default is "max". Maximum allowed descent depth below the current cgroup. If the actual descent depth is equal or larger, an attempt to create a new child cgroup will fail. cgroup.stat A read-only flat-keyed file with the following entries: nr_descendants Total number of visible descendant cgroups. nr_dying_descendants Total number of dying descendant cgroups. A cgroup becomes dying after being deleted by a user. The cgroup will remain in dying state for some time undefined time (which can depend on system load) before being completely destroyed. A process can't enter a dying cgroup under any circumstances, a dying cgroup can't revive. A dying cgroup can consume system resources not exceeding limits, which were active at the moment of cgroup deletion. nr_subsys_ Total number of live cgroup subsystems (e.g memory cgroup) at and beneath the current cgroup. nr_dying_subsys_ Total number of dying cgroup subsystems (e.g. memory cgroup) at and beneath the current cgroup. cgroup.freeze A read-write single value file which exists on non-root cgroups. Allowed values are "0" and "1". The default is "0". Writing "1" to the file causes freezing of the cgroup and all descendant cgroups. This means that all belonging processes will be stopped and will not run until the cgroup will be explicitly unfrozen. Freezing of the cgroup may take some time; when this action is completed, the "frozen" value in the cgroup.events control file will be updated to "1" and the corresponding notification will be issued. A cgroup can be frozen either by its own settings, or by settings of any ancestor cgroups. If any of ancestor cgroups is frozen, the cgroup will remain frozen. Processes in the frozen cgroup can be killed by a fatal signal. They also can enter and leave a frozen cgroup: either by an explicit move by a user, or if freezing of the cgroup races with fork(). If a process is moved to a frozen cgroup, it stops. If a process is moved out of a frozen cgroup, it becomes running. Frozen status of a cgroup doesn't affect any cgroup tree operations: it's possible to delete a frozen (and empty) cgroup, as well as create new sub-cgroups. cgroup.kill A write-only single value file which exists in non-root cgroups. The only allowed value is "1". Writing "1" to the file causes the cgroup and all descendant cgroups to be killed. This means that all processes located in the affected cgroup tree will be killed via SIGKILL. Killing a cgroup tree will deal with concurrent forks appropriately and is protected against migrations. In a threaded cgroup, writing this file fails with EOPNOTSUPP as killing cgroups is a process directed operation, i.e. it affects the whole thread-group. cgroup.pressure A read-write single value file that allowed values are "0" and "1". The default is "1". Writing "0" to the file will disable the cgroup PSI accounting. Writing "1" to the file will re-enable the cgroup PSI accounting. This control attribute is not hierarchical, so disable or enable PSI accounting in a cgroup does not affect PSI accounting in descendants and doesn't need pass enablement via ancestors from root. The reason this control attribute exists is that PSI accounts stalls for each cgroup separately and aggregates it at each level of the hierarchy. This may cause non-negligible overhead for some workloads when under deep level of the hierarchy, in which case this control attribute can be used to disable PSI accounting in the non-leaf cgroups. irq.pressure A read-write nested-keyed file. Shows pressure stall information for IRQ/SOFTIRQ. See :ref:`Documentation/accounting/psi.rst ` for details. h]j)}(hhh](j)}(hXcgroup.type A read-write single value file which exists on non-root cgroups. When read, it indicates the current type of the cgroup, which can be one of the following values. - "domain" : A normal valid domain cgroup. - "domain threaded" : A threaded domain cgroup which is serving as the root of a threaded subtree. - "domain invalid" : A cgroup which is in an invalid state. It can't be populated or have controllers enabled. It may be allowed to become a threaded cgroup. - "threaded" : A threaded cgroup which is a member of a threaded subtree. A cgroup can be turned into a threaded cgroup by writing "threaded" to this file. h](j)}(h cgroup.typeh]h cgroup.type}(hj_ hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMdhj[ ubj)}(hhh](h)}(h@A read-write single value file which exists on non-root cgroups.h]h@A read-write single value file which exists on non-root cgroups.}(hjp hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMQhjm ubh)}(haWhen read, it indicates the current type of the cgroup, which can be one of the following values.h]haWhen read, it indicates the current type of the cgroup, which can be one of the following values.}(hj~ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMThjm ubj)}(hhh](j)}(h)"domain" : A normal valid domain cgroup. h]h)}(h("domain" : A normal valid domain cgroup.h]h,“domain” : A normal valid domain cgroup.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMWhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(ha"domain threaded" : A threaded domain cgroup which is serving as the root of a threaded subtree. h]h)}(h`"domain threaded" : A threaded domain cgroup which is serving as the root of a threaded subtree.h]hd“domain threaded” : A threaded domain cgroup which is serving as the root of a threaded subtree.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMYhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(h"domain invalid" : A cgroup which is in an invalid state. It can't be populated or have controllers enabled. It may be allowed to become a threaded cgroup. h]h)}(h"domain invalid" : A cgroup which is in an invalid state. It can't be populated or have controllers enabled. It may be allowed to become a threaded cgroup.h]h“domain invalid” : A cgroup which is in an invalid state. It can’t be populated or have controllers enabled. It may be allowed to become a threaded cgroup.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM\hj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hH"threaded" : A threaded cgroup which is a member of a threaded subtree. h]h)}(hG"threaded" : A threaded cgroup which is a member of a threaded subtree.h]hK“threaded” : A threaded cgroup which is a member of a threaded subtree.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM`hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]jjuh1jhhhMWhjm ubh)}(hQA cgroup can be turned into a threaded cgroup by writing "threaded" to this file.h]hUA cgroup can be turned into a threaded cgroup by writing “threaded” to this file.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMchjm ubeh}(h]h ]h"]h$]h&]uh1jhj[ ubeh}(h]h ]h"]h$]h&]uh1jhhhMdhjX ubj)}(hXcgroup.procs A read-write new-line separated values file which exists on all cgroups. When read, it lists the PIDs of all processes which belong to the cgroup one-per-line. The PIDs are not ordered and the same PID may show up more than once if the process got moved to another cgroup and then back or the PID got recycled while reading. A PID can be written to migrate the process associated with the PID to the cgroup. The writer should match all of the following conditions. - It must have write access to the "cgroup.procs" file. - It must have write access to the "cgroup.procs" file of the common ancestor of the source and destination cgroups. When delegating a sub-hierarchy, write access to this file should be granted along with the containing directory. In a threaded cgroup, reading this file fails with EOPNOTSUPP as all the processes belong to the thread root. Writing is supported and moves every thread of the process to the cgroup. h](j)}(h cgroup.procsh]h cgroup.procs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM~hjubj)}(hhh](h)}(hHA read-write new-line separated values file which exists on all cgroups.h]hHA read-write new-line separated values file which exists on all cgroups.}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMghj!ubh)}(hWhen read, it lists the PIDs of all processes which belong to the cgroup one-per-line. The PIDs are not ordered and the same PID may show up more than once if the process got moved to another cgroup and then back or the PID got recycled while reading.h]hWhen read, it lists the PIDs of all processes which belong to the cgroup one-per-line. The PIDs are not ordered and the same PID may show up more than once if the process got moved to another cgroup and then back or the PID got recycled while reading.}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMjhj!ubh)}(hA PID can be written to migrate the process associated with the PID to the cgroup. The writer should match all of the following conditions.h]hA PID can be written to migrate the process associated with the PID to the cgroup. The writer should match all of the following conditions.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMphj!ubj)}(hhh](j)}(h6It must have write access to the "cgroup.procs" file. h]h)}(h5It must have write access to the "cgroup.procs" file.h]h9It must have write access to the “cgroup.procs” file.}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMthjQubah}(h]h ]h"]h$]h&]uh1jhjNubj)}(hsIt must have write access to the "cgroup.procs" file of the common ancestor of the source and destination cgroups. h]h)}(hrIt must have write access to the "cgroup.procs" file of the common ancestor of the source and destination cgroups.h]hvIt must have write access to the “cgroup.procs” file of the common ancestor of the source and destination cgroups.}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMvhjiubah}(h]h ]h"]h$]h&]uh1jhjNubeh}(h]h ]h"]h$]h&]jjuh1jhhhMthj!ubh)}(hqWhen delegating a sub-hierarchy, write access to this file should be granted along with the containing directory.h]hqWhen delegating a sub-hierarchy, write access to this file should be granted along with the containing directory.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMyhj!ubh)}(hIn a threaded cgroup, reading this file fails with EOPNOTSUPP as all the processes belong to the thread root. Writing is supported and moves every thread of the process to the cgroup.h]hIn a threaded cgroup, reading this file fails with EOPNOTSUPP as all the processes belong to the thread root. Writing is supported and moves every thread of the process to the cgroup.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM|hj!ubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhM~hjX ubj)}(hXucgroup.threads A read-write new-line separated values file which exists on all cgroups. When read, it lists the TIDs of all threads which belong to the cgroup one-per-line. The TIDs are not ordered and the same TID may show up more than once if the thread got moved to another cgroup and then back or the TID got recycled while reading. A TID can be written to migrate the thread associated with the TID to the cgroup. The writer should match all of the following conditions. - It must have write access to the "cgroup.threads" file. - The cgroup that the thread is currently in must be in the same resource domain as the destination cgroup. - It must have write access to the "cgroup.procs" file of the common ancestor of the source and destination cgroups. When delegating a sub-hierarchy, write access to this file should be granted along with the containing directory. h](j)}(hcgroup.threadsh]hcgroup.threads}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh](h)}(hHA read-write new-line separated values file which exists on all cgroups.h]hHA read-write new-line separated values file which exists on all cgroups.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hWhen read, it lists the TIDs of all threads which belong to the cgroup one-per-line. The TIDs are not ordered and the same TID may show up more than once if the thread got moved to another cgroup and then back or the TID got recycled while reading.h]hWhen read, it lists the TIDs of all threads which belong to the cgroup one-per-line. The TIDs are not ordered and the same TID may show up more than once if the thread got moved to another cgroup and then back or the TID got recycled while reading.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hA TID can be written to migrate the thread associated with the TID to the cgroup. The writer should match all of the following conditions.h]hA TID can be written to migrate the thread associated with the TID to the cgroup. The writer should match all of the following conditions.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hhh](j)}(h8It must have write access to the "cgroup.threads" file. h]h)}(h7It must have write access to the "cgroup.threads" file.h]h;It must have write access to the “cgroup.threads” file.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hjThe cgroup that the thread is currently in must be in the same resource domain as the destination cgroup. h]h)}(hiThe cgroup that the thread is currently in must be in the same resource domain as the destination cgroup.h]hiThe cgroup that the thread is currently in must be in the same resource domain as the destination cgroup.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hsIt must have write access to the "cgroup.procs" file of the common ancestor of the source and destination cgroups. h]h)}(hrIt must have write access to the "cgroup.procs" file of the common ancestor of the source and destination cgroups.h]hvIt must have write access to the “cgroup.procs” file of the common ancestor of the source and destination cgroups.}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj!ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]jjuh1jhhhMhjubh)}(hqWhen delegating a sub-hierarchy, write access to this file should be granted along with the containing directory.h]hqWhen delegating a sub-hierarchy, write access to this file should be granted along with the containing directory.}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjX ubj)}(hcgroup.controllers A read-only space separated values file which exists on all cgroups. It shows space separated list of all controllers available to the cgroup. The controllers are not ordered. h](j)}(hcgroup.controllersh]hcgroup.controllers}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjYubj)}(hhh](h)}(hDA read-only space separated values file which exists on all cgroups.h]hDA read-only space separated values file which exists on all cgroups.}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjkubh)}(hkIt shows space separated list of all controllers available to the cgroup. The controllers are not ordered.h]hkIt shows space separated list of all controllers available to the cgroup. The controllers are not ordered.}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjkubeh}(h]h ]h"]h$]h&]uh1jhjYubeh}(h]h ]h"]h$]h&]uh1jhhhMhjX ubj)}(hXjcgroup.subtree_control A read-write space separated values file which exists on all cgroups. Starts out empty. When read, it shows space separated list of the controllers which are enabled to control resource distribution from the cgroup to its children. Space separated list of controllers prefixed with '+' or '-' can be written to enable or disable controllers. A controller name prefixed with '+' enables the controller and '-' disables. If a controller appears more than once on the list, the last one is effective. When multiple enable and disable operations are specified, either all succeed or all fail. h](j)}(hcgroup.subtree_controlh]hcgroup.subtree_control}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh](h)}(hXA read-write space separated values file which exists on all cgroups. Starts out empty.h]hXA read-write space separated values file which exists on all cgroups. Starts out empty.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hWhen read, it shows space separated list of the controllers which are enabled to control resource distribution from the cgroup to its children.h]hWhen read, it shows space separated list of the controllers which are enabled to control resource distribution from the cgroup to its children.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hXgSpace separated list of controllers prefixed with '+' or '-' can be written to enable or disable controllers. A controller name prefixed with '+' enables the controller and '-' disables. If a controller appears more than once on the list, the last one is effective. When multiple enable and disable operations are specified, either all succeed or all fail.h]hXwSpace separated list of controllers prefixed with ‘+’ or ‘-’ can be written to enable or disable controllers. A controller name prefixed with ‘+’ enables the controller and ‘-’ disables. If a controller appears more than once on the list, the last one is effective. When multiple enable and disable operations are specified, either all succeed or all fail.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjX ubj)}(hXncgroup.events A read-only flat-keyed file which exists on non-root cgroups. The following entries are defined. Unless specified otherwise, a value change in this file generates a file modified event. populated 1 if the cgroup or its descendants contains any live processes; otherwise, 0. frozen 1 if the cgroup is frozen; otherwise, 0. h](j)}(h cgroup.eventsh]h cgroup.events}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh](h)}(hA read-only flat-keyed file which exists on non-root cgroups. The following entries are defined. Unless specified otherwise, a value change in this file generates a file modified event.h]hA read-only flat-keyed file which exists on non-root cgroups. The following entries are defined. Unless specified otherwise, a value change in this file generates a file modified event.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hpopulated 1 if the cgroup or its descendants contains any live processes; otherwise, 0. frozen 1 if the cgroup is frozen; otherwise, 0. h]j)}(hhh](j)}(hWpopulated 1 if the cgroup or its descendants contains any live processes; otherwise, 0.h](j)}(h populatedh]h populated}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj ubj)}(hhh]h)}(hM1 if the cgroup or its descendants contains any live processes; otherwise, 0.h]hM1 if the cgroup or its descendants contains any live processes; otherwise, 0.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(h0frozen 1 if the cgroup is frozen; otherwise, 0. h](j)}(hfrozenh]hfrozen}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj:ubj)}(hhh]h)}(h(1 if the cgroup is frozen; otherwise, 0.h]h(1 if the cgroup is frozen; otherwise, 0.}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjLubah}(h]h ]h"]h$]h&]uh1jhj:ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjX ubj)}(hcgroup.max.descendants A read-write single value files. The default is "max". Maximum allowed number of descent cgroups. If the actual number of descendants is equal or larger, an attempt to create a new cgroup in the hierarchy will fail. h](j)}(hcgroup.max.descendantsh]hcgroup.max.descendants}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh](h)}(h7A read-write single value files. The default is "max".h]h;A read-write single value files. The default is “max”.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hMaximum allowed number of descent cgroups. If the actual number of descendants is equal or larger, an attempt to create a new cgroup in the hierarchy will fail.h]hMaximum allowed number of descent cgroups. If the actual number of descendants is equal or larger, an attempt to create a new cgroup in the hierarchy will fail.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjX ubj)}(hcgroup.max.depth A read-write single value files. The default is "max". Maximum allowed descent depth below the current cgroup. If the actual descent depth is equal or larger, an attempt to create a new child cgroup will fail. h](j)}(hcgroup.max.depthh]hcgroup.max.depth}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh](h)}(h7A read-write single value files. The default is "max".h]h;A read-write single value files. The default is “max”.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hMaximum allowed descent depth below the current cgroup. If the actual descent depth is equal or larger, an attempt to create a new child cgroup will fail.h]hMaximum allowed descent depth below the current cgroup. If the actual descent depth is equal or larger, an attempt to create a new child cgroup will fail.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjX ubj)}(hXcgroup.stat A read-only flat-keyed file with the following entries: nr_descendants Total number of visible descendant cgroups. nr_dying_descendants Total number of dying descendant cgroups. A cgroup becomes dying after being deleted by a user. The cgroup will remain in dying state for some time undefined time (which can depend on system load) before being completely destroyed. A process can't enter a dying cgroup under any circumstances, a dying cgroup can't revive. A dying cgroup can consume system resources not exceeding limits, which were active at the moment of cgroup deletion. nr_subsys_ Total number of live cgroup subsystems (e.g memory cgroup) at and beneath the current cgroup. nr_dying_subsys_ Total number of dying cgroup subsystems (e.g. memory cgroup) at and beneath the current cgroup. h](j)}(h cgroup.stath]h cgroup.stat}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh](h)}(h7A read-only flat-keyed file with the following entries:h]h7A read-only flat-keyed file with the following entries:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubj)}(hXTnr_descendants Total number of visible descendant cgroups. nr_dying_descendants Total number of dying descendant cgroups. A cgroup becomes dying after being deleted by a user. The cgroup will remain in dying state for some time undefined time (which can depend on system load) before being completely destroyed. A process can't enter a dying cgroup under any circumstances, a dying cgroup can't revive. A dying cgroup can consume system resources not exceeding limits, which were active at the moment of cgroup deletion. nr_subsys_ Total number of live cgroup subsystems (e.g memory cgroup) at and beneath the current cgroup. nr_dying_subsys_ Total number of dying cgroup subsystems (e.g. memory cgroup) at and beneath the current cgroup. h]j)}(hhh](j)}(h;nr_descendants Total number of visible descendant cgroups. h](j)}(hnr_descendantsh]hnr_descendants}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj%ubj)}(hhh]h)}(h+Total number of visible descendant cgroups.h]h+Total number of visible descendant cgroups.}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj7ubah}(h]h ]h"]h$]h&]uh1jhj%ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj"ubj)}(hXnr_dying_descendants Total number of dying descendant cgroups. A cgroup becomes dying after being deleted by a user. The cgroup will remain in dying state for some time undefined time (which can depend on system load) before being completely destroyed. A process can't enter a dying cgroup under any circumstances, a dying cgroup can't revive. A dying cgroup can consume system resources not exceeding limits, which were active at the moment of cgroup deletion. h](j)}(hnr_dying_descendants5h]hnr_dying_descendants}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjTubj)}(hhh](h)}(hTotal number of dying descendant cgroups. A cgroup becomes dying after being deleted by a user. The cgroup will remain in dying state for some time undefined time (which can depend on system load) before being completely destroyed.h]hTotal number of dying descendant cgroups. A cgroup becomes dying after being deleted by a user. The cgroup will remain in dying state for some time undefined time (which can depend on system load) before being completely destroyed.}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjfubh)}(hZA process can't enter a dying cgroup under any circumstances, a dying cgroup can't revive.h]h^A process can’t enter a dying cgroup under any circumstances, a dying cgroup can’t revive.}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjfubh)}(huA dying cgroup can consume system resources not exceeding limits, which were active at the moment of cgroup deletion.h]huA dying cgroup can consume system resources not exceeding limits, which were active at the moment of cgroup deletion.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjfubeh}(h]h ]h"]h$]h&]uh1jhjTubeh}(h]h ]h"]h$]h&]uh1jhhhMhj"ubj)}(hxnr_subsys_ Total number of live cgroup subsystems (e.g memory cgroup) at and beneath the current cgroup. h](j)}(hnr_subsys_h]hnr_subsys_}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh]h)}(h]Total number of live cgroup subsystems (e.g memory cgroup) at and beneath the current cgroup.h]h]Total number of live cgroup subsystems (e.g memory cgroup) at and beneath the current cgroup.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhj"ubj)}(hnr_dying_subsys_ Total number of dying cgroup subsystems (e.g. memory cgroup) at and beneath the current cgroup. h](j)}(hnr_dying_subsys_h]hnr_dying_subsys_}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh]h)}(h_Total number of dying cgroup subsystems (e.g. memory cgroup) at and beneath the current cgroup.h]h_Total number of dying cgroup subsystems (e.g. memory cgroup) at and beneath the current cgroup.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhj"ubeh}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMhj ubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjX ubj)}(hXcgroup.freeze A read-write single value file which exists on non-root cgroups. Allowed values are "0" and "1". The default is "0". Writing "1" to the file causes freezing of the cgroup and all descendant cgroups. This means that all belonging processes will be stopped and will not run until the cgroup will be explicitly unfrozen. Freezing of the cgroup may take some time; when this action is completed, the "frozen" value in the cgroup.events control file will be updated to "1" and the corresponding notification will be issued. A cgroup can be frozen either by its own settings, or by settings of any ancestor cgroups. If any of ancestor cgroups is frozen, the cgroup will remain frozen. Processes in the frozen cgroup can be killed by a fatal signal. They also can enter and leave a frozen cgroup: either by an explicit move by a user, or if freezing of the cgroup races with fork(). If a process is moved to a frozen cgroup, it stops. If a process is moved out of a frozen cgroup, it becomes running. Frozen status of a cgroup doesn't affect any cgroup tree operations: it's possible to delete a frozen (and empty) cgroup, as well as create new sub-cgroups. h](j)}(h cgroup.freezeh]h cgroup.freeze}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh](h)}(htA read-write single value file which exists on non-root cgroups. Allowed values are "0" and "1". The default is "0".h]hA read-write single value file which exists on non-root cgroups. Allowed values are “0” and “1”. The default is “0”.}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj'ubh)}(hXWriting "1" to the file causes freezing of the cgroup and all descendant cgroups. This means that all belonging processes will be stopped and will not run until the cgroup will be explicitly unfrozen. Freezing of the cgroup may take some time; when this action is completed, the "frozen" value in the cgroup.events control file will be updated to "1" and the corresponding notification will be issued.h]hXWriting “1” to the file causes freezing of the cgroup and all descendant cgroups. This means that all belonging processes will be stopped and will not run until the cgroup will be explicitly unfrozen. Freezing of the cgroup may take some time; when this action is completed, the “frozen” value in the cgroup.events control file will be updated to “1” and the corresponding notification will be issued.}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj'ubh)}(hA cgroup can be frozen either by its own settings, or by settings of any ancestor cgroups. If any of ancestor cgroups is frozen, the cgroup will remain frozen.h]hA cgroup can be frozen either by its own settings, or by settings of any ancestor cgroups. If any of ancestor cgroups is frozen, the cgroup will remain frozen.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj'ubh)}(hX:Processes in the frozen cgroup can be killed by a fatal signal. They also can enter and leave a frozen cgroup: either by an explicit move by a user, or if freezing of the cgroup races with fork(). If a process is moved to a frozen cgroup, it stops. If a process is moved out of a frozen cgroup, it becomes running.h]hX:Processes in the frozen cgroup can be killed by a fatal signal. They also can enter and leave a frozen cgroup: either by an explicit move by a user, or if freezing of the cgroup races with fork(). If a process is moved to a frozen cgroup, it stops. If a process is moved out of a frozen cgroup, it becomes running.}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj'ubh)}(hFrozen status of a cgroup doesn't affect any cgroup tree operations: it's possible to delete a frozen (and empty) cgroup, as well as create new sub-cgroups.h]hFrozen status of a cgroup doesn’t affect any cgroup tree operations: it’s possible to delete a frozen (and empty) cgroup, as well as create new sub-cgroups.}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj'ubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjX ubj)}(hX#cgroup.kill A write-only single value file which exists in non-root cgroups. The only allowed value is "1". Writing "1" to the file causes the cgroup and all descendant cgroups to be killed. This means that all processes located in the affected cgroup tree will be killed via SIGKILL. Killing a cgroup tree will deal with concurrent forks appropriately and is protected against migrations. In a threaded cgroup, writing this file fails with EOPNOTSUPP as killing cgroups is a process directed operation, i.e. it affects the whole thread-group. h](j)}(h cgroup.killh]h cgroup.kill}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hj|ubj)}(hhh](h)}(h_A write-only single value file which exists in non-root cgroups. The only allowed value is "1".h]hcA write-only single value file which exists in non-root cgroups. The only allowed value is “1”.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hWriting "1" to the file causes the cgroup and all descendant cgroups to be killed. This means that all processes located in the affected cgroup tree will be killed via SIGKILL.h]hWriting “1” to the file causes the cgroup and all descendant cgroups to be killed. This means that all processes located in the affected cgroup tree will be killed via SIGKILL.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hhKilling a cgroup tree will deal with concurrent forks appropriately and is protected against migrations.h]hhKilling a cgroup tree will deal with concurrent forks appropriately and is protected against migrations.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hIn a threaded cgroup, writing this file fails with EOPNOTSUPP as killing cgroups is a process directed operation, i.e. it affects the whole thread-group.h]hIn a threaded cgroup, writing this file fails with EOPNOTSUPP as killing cgroups is a process directed operation, i.e. it affects the whole thread-group.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhj|ubeh}(h]h ]h"]h$]h&]uh1jhhhM hjX ubj)}(hX cgroup.pressure A read-write single value file that allowed values are "0" and "1". The default is "1". Writing "0" to the file will disable the cgroup PSI accounting. Writing "1" to the file will re-enable the cgroup PSI accounting. This control attribute is not hierarchical, so disable or enable PSI accounting in a cgroup does not affect PSI accounting in descendants and doesn't need pass enablement via ancestors from root. The reason this control attribute exists is that PSI accounts stalls for each cgroup separately and aggregates it at each level of the hierarchy. This may cause non-negligible overhead for some workloads when under deep level of the hierarchy, in which case this control attribute can be used to disable PSI accounting in the non-leaf cgroups. h](j)}(hcgroup.pressureh]hcgroup.pressure}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh](h)}(hWA read-write single value file that allowed values are "0" and "1". The default is "1".h]hcA read-write single value file that allowed values are “0” and “1”. The default is “1”.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjubh)}(hWriting "0" to the file will disable the cgroup PSI accounting. Writing "1" to the file will re-enable the cgroup PSI accounting.h]hWriting “0” to the file will disable the cgroup PSI accounting. Writing “1” to the file will re-enable the cgroup PSI accounting.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hThis control attribute is not hierarchical, so disable or enable PSI accounting in a cgroup does not affect PSI accounting in descendants and doesn't need pass enablement via ancestors from root.h]hThis control attribute is not hierarchical, so disable or enable PSI accounting in a cgroup does not affect PSI accounting in descendants and doesn’t need pass enablement via ancestors from root.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hXWThe reason this control attribute exists is that PSI accounts stalls for each cgroup separately and aggregates it at each level of the hierarchy. This may cause non-negligible overhead for some workloads when under deep level of the hierarchy, in which case this control attribute can be used to disable PSI accounting in the non-leaf cgroups.h]hXWThe reason this control attribute exists is that PSI accounts stalls for each cgroup separately and aggregates it at each level of the hierarchy. This may cause non-negligible overhead for some workloads when under deep level of the hierarchy, in which case this control attribute can be used to disable PSI accounting in the non-leaf cgroups.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjX ubj)}(hirq.pressure A read-write nested-keyed file. Shows pressure stall information for IRQ/SOFTIRQ. See :ref:`Documentation/accounting/psi.rst ` for details. h](j)}(h irq.pressureh]h irq.pressure}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM!hj.ubj)}(hhh](h)}(hA read-write nested-keyed file.h]hA read-write nested-keyed file.}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj@ubh)}(hpShows pressure stall information for IRQ/SOFTIRQ. See :ref:`Documentation/accounting/psi.rst ` for details.h](h6Shows pressure stall information for IRQ/SOFTIRQ. See }(hjQhhhNhNubh)}(h-:ref:`Documentation/accounting/psi.rst `h]jX)}(hj[h]h Documentation/accounting/psi.rst}(hj]hhhNhNubah}(h]h ](jcstdstd-refeh"]h$]h&]uh1jWhjYubah}(h]h ]h"]h$]h&]refdocjp refdomainjgreftyperef refexplicitrefwarnjvpsiuh1hhhhM hjQubh for details.}(hjQhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM hj@ubeh}(h]h ]h"]h$]h&]uh1jhj.ubeh}(h]h ]h"]h$]h&]uh1jhhhM!hjX ubeh}(h]h ]h"]h$]h&]uh1jhjT ubah}(h]h ]h"]h$]h&]uh1jhhhMPhj5 hhubeh}(h]core-interface-filesah ]h"]core interface filesah$]h&]uh1hhj; hhhhhMLubeh}(h]interface-filesah ]h"]interface filesah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(h Controllersh]h Controllers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM$ubh)}(h.. _cgroup-v2-cpu:h]h}(h]h ]h"]h$]h&]h cgroup-v2-cpuuh1hhM&hjhhhhubh)}(hhh](h)}(hCPUh]hCPU}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM)ubh)}(hThe "cpu" controllers regulates distribution of CPU cycles. This controller implements weight and absolute bandwidth limit models for normal scheduling policy and absolute bandwidth allocation model for realtime scheduling policy.h]hThe “cpu” controllers regulates distribution of CPU cycles. This controller implements weight and absolute bandwidth limit models for normal scheduling policy and absolute bandwidth allocation model for realtime scheduling policy.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM+hjhhubh)}(hXIn all the above models, cycles distribution is defined only on a temporal base and it does not account for the frequency at which tasks are executed. The (optional) utilization clamping support allows to hint the schedutil cpufreq governor about the minimum desired frequency which should always be provided by a CPU, as well as the maximum desired frequency, which should not be exceeded by a CPU.h]hXIn all the above models, cycles distribution is defined only on a temporal base and it does not account for the frequency at which tasks are executed. The (optional) utilization clamping support allows to hint the schedutil cpufreq governor about the minimum desired frequency which should always be provided by a CPU, as well as the maximum desired frequency, which should not be exceeded by a CPU.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM0hjhhubh)}(hX4WARNING: cgroup2 cpu controller doesn't yet fully support the control of realtime processes. For a kernel built with the CONFIG_RT_GROUP_SCHED option enabled for group scheduling of realtime processes, the cpu controller can only be enabled when all RT processes are in the root cgroup. Be aware that system management software may already have placed RT processes into non-root cgroups during the system boot process, and these processes may need to be moved to the root cgroup before the cpu controller can be enabled with a CONFIG_RT_GROUP_SCHED enabled kernel.h]hX6WARNING: cgroup2 cpu controller doesn’t yet fully support the control of realtime processes. For a kernel built with the CONFIG_RT_GROUP_SCHED option enabled for group scheduling of realtime processes, the cpu controller can only be enabled when all RT processes are in the root cgroup. Be aware that system management software may already have placed RT processes into non-root cgroups during the system boot process, and these processes may need to be moved to the root cgroup before the cpu controller can be enabled with a CONFIG_RT_GROUP_SCHED enabled kernel.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM7hjhhubh)}(hXrWith CONFIG_RT_GROUP_SCHED disabled, this limitation does not apply and some of the interface files either affect realtime processes or account for them. See the following section for details. Only the cpu controller is affected by CONFIG_RT_GROUP_SCHED. Other controllers can be used for the resource control of realtime processes irrespective of CONFIG_RT_GROUP_SCHED.h]hXrWith CONFIG_RT_GROUP_SCHED disabled, this limitation does not apply and some of the interface files either affect realtime processes or account for them. See the following section for details. Only the cpu controller is affected by CONFIG_RT_GROUP_SCHED. Other controllers can be used for the resource control of realtime processes irrespective of CONFIG_RT_GROUP_SCHED.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM@hjhhubh)}(hhh](h)}(hCPU Interface Filesh]hCPU Interface Files}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMHubh)}(h'All time durations are in microseconds.h]h'All time durations are in microseconds.}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMJhjhhubj)}(hXy cpu.stat A read-only flat-keyed file. This file exists whether the controller is enabled or not. It always reports the following three stats: - usage_usec - user_usec - system_usec and the following five when the controller is enabled: - nr_periods - nr_throttled - throttled_usec - nr_bursts - burst_usec cpu.weight A read-write single value file which exists on non-root cgroups. The default is "100". For non idle groups (cpu.idle = 0), the weight is in the range [1, 10000]. If the cgroup has been configured to be SCHED_IDLE (cpu.idle = 1), then the weight will show as a 0. cpu.weight.nice A read-write single value file which exists on non-root cgroups. The default is "0". The nice value is in the range [-20, 19]. This interface file is an alternative interface for "cpu.weight" and allows reading and setting weight using the same values used by nice(2). Because the range is smaller and granularity is coarser for the nice values, the read value is the closest approximation of the current weight. cpu.max A read-write two value file which exists on non-root cgroups. The default is "max 100000". The maximum bandwidth limit. It's in the following format:: $MAX $PERIOD which indicates that the group may consume up to $MAX in each $PERIOD duration. "max" for $MAX indicates no limit. If only one number is written, $MAX is updated. cpu.max.burst A read-write single value file which exists on non-root cgroups. The default is "0". The burst in the range [0, $MAX]. cpu.pressure A read-write nested-keyed file. Shows pressure stall information for CPU. See :ref:`Documentation/accounting/psi.rst ` for details. cpu.uclamp.min A read-write single value file which exists on non-root cgroups. The default is "0", i.e. no utilization boosting. The requested minimum utilization (protection) as a percentage rational number, e.g. 12.34 for 12.34%. This interface allows reading and setting minimum utilization clamp values similar to the sched_setattr(2). This minimum utilization value is used to clamp the task specific minimum utilization clamp. The requested minimum utilization (protection) is always capped by the current value for the maximum utilization (limit), i.e. `cpu.uclamp.max`. cpu.uclamp.max A read-write single value file which exists on non-root cgroups. The default is "max". i.e. no utilization capping The requested maximum utilization (limit) as a percentage rational number, e.g. 98.76 for 98.76%. This interface allows reading and setting maximum utilization clamp values similar to the sched_setattr(2). This maximum utilization value is used to clamp the task specific maximum utilization clamp. cpu.idle A read-write single value file which exists on non-root cgroups. The default is 0. This is the cgroup analog of the per-task SCHED_IDLE sched policy. Setting this value to a 1 will make the scheduling policy of the cgroup SCHED_IDLE. The threads inside the cgroup will retain their own relative priorities, but the cgroup itself will be treated as very low priority relative to its peers. h]j)}(hhh](j)}(hX6cpu.stat A read-only flat-keyed file. This file exists whether the controller is enabled or not. It always reports the following three stats: - usage_usec - user_usec - system_usec and the following five when the controller is enabled: - nr_periods - nr_throttled - throttled_usec - nr_bursts - burst_usec h](j)}(hcpu.stath]hcpu.stat}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM\hj6ubj)}(hhh](h)}(hWA read-only flat-keyed file. This file exists whether the controller is enabled or not.h]hWA read-only flat-keyed file. This file exists whether the controller is enabled or not.}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMMhjHubh)}(h,It always reports the following three stats:h]h,It always reports the following three stats:}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMPhjHubj)}(hhh](j)}(h usage_usech]h)}(hjlh]h usage_usec}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMRhjjubah}(h]h ]h"]h$]h&]uh1jhjgubj)}(h user_usech]h)}(hjh]h user_usec}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMShjubah}(h]h ]h"]h$]h&]uh1jhjgubj)}(h system_usec h]h)}(h system_usech]h system_usec}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMThjubah}(h]h ]h"]h$]h&]uh1jhjgubeh}(h]h ]h"]h$]h&]jjuh1jhhhMRhjHubh)}(h6and the following five when the controller is enabled:h]h6and the following five when the controller is enabled:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMVhjHubj)}(hhh](j)}(h nr_periodsh]h)}(hjh]h nr_periods}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMXhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h nr_throttledh]h)}(hjh]h nr_throttled}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMYhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hthrottled_usech]h)}(hjh]hthrottled_usec}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMZhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h nr_burstsh]h)}(hjh]h nr_bursts}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM[hj ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h burst_usec h]h)}(h burst_usech]h burst_usec}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM\hj#ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]jjuh1jhhhMXhjHubeh}(h]h ]h"]h$]h&]uh1jhj6ubeh}(h]h ]h"]h$]h&]uh1jhhhM\hj3ubj)}(hXcpu.weight A read-write single value file which exists on non-root cgroups. The default is "100". For non idle groups (cpu.idle = 0), the weight is in the range [1, 10000]. If the cgroup has been configured to be SCHED_IDLE (cpu.idle = 1), then the weight will show as a 0. h](j)}(h cpu.weighth]h cpu.weight}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMfhjMubj)}(hhh](h)}(hWA read-write single value file which exists on non-root cgroups. The default is "100".h]h[A read-write single value file which exists on non-root cgroups. The default is “100”.}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM_hj_ubh)}(hJFor non idle groups (cpu.idle = 0), the weight is in the range [1, 10000].h]hJFor non idle groups (cpu.idle = 0), the weight is in the range [1, 10000].}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMbhj_ubh)}(hdIf the cgroup has been configured to be SCHED_IDLE (cpu.idle = 1), then the weight will show as a 0.h]hdIf the cgroup has been configured to be SCHED_IDLE (cpu.idle = 1), then the weight will show as a 0.}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMehj_ubeh}(h]h ]h"]h$]h&]uh1jhjMubeh}(h]h ]h"]h$]h&]uh1jhhhMfhj3ubj)}(hXcpu.weight.nice A read-write single value file which exists on non-root cgroups. The default is "0". The nice value is in the range [-20, 19]. This interface file is an alternative interface for "cpu.weight" and allows reading and setting weight using the same values used by nice(2). Because the range is smaller and granularity is coarser for the nice values, the read value is the closest approximation of the current weight. h](j)}(hcpu.weight.niceh]hcpu.weight.nice}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMrhjubj)}(hhh](h)}(hUA read-write single value file which exists on non-root cgroups. The default is "0".h]hYA read-write single value file which exists on non-root cgroups. The default is “0”.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMihjubh)}(h)The nice value is in the range [-20, 19].h]h)The nice value is in the range [-20, 19].}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMlhjubh)}(hXThis interface file is an alternative interface for "cpu.weight" and allows reading and setting weight using the same values used by nice(2). Because the range is smaller and granularity is coarser for the nice values, the read value is the closest approximation of the current weight.h]hX"This interface file is an alternative interface for “cpu.weight” and allows reading and setting weight using the same values used by nice(2). Because the range is smaller and granularity is coarser for the nice values, the read value is the closest approximation of the current weight.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMnhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMrhj3ubj)}(hXWcpu.max A read-write two value file which exists on non-root cgroups. The default is "max 100000". The maximum bandwidth limit. It's in the following format:: $MAX $PERIOD which indicates that the group may consume up to $MAX in each $PERIOD duration. "max" for $MAX indicates no limit. If only one number is written, $MAX is updated. h](j)}(hcpu.maxh]hcpu.max}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM~hjubj)}(hhh](h)}(hZA read-write two value file which exists on non-root cgroups. The default is "max 100000".h]h^A read-write two value file which exists on non-root cgroups. The default is “max 100000”.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMuhjubh)}(h` for details. h](j)}(h cpu.pressureh]h cpu.pressure}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjyubj)}(hhh](h)}(hA read-write nested-keyed file.h]hA read-write nested-keyed file.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hhShows pressure stall information for CPU. See :ref:`Documentation/accounting/psi.rst ` for details.h](h.Shows pressure stall information for CPU. See }(hjhhhNhNubh)}(h-:ref:`Documentation/accounting/psi.rst `h]jX)}(hjh]h Documentation/accounting/psi.rst}(hjhhhNhNubah}(h]h ](jcstdstd-refeh"]h$]h&]uh1jWhjubah}(h]h ]h"]h$]h&]refdocjp refdomainjreftyperef refexplicitrefwarnjvpsiuh1hhhhMhjubh for details.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjyubeh}(h]h ]h"]h$]h&]uh1jhhhMhj3ubj)}(hXFcpu.uclamp.min A read-write single value file which exists on non-root cgroups. The default is "0", i.e. no utilization boosting. The requested minimum utilization (protection) as a percentage rational number, e.g. 12.34 for 12.34%. This interface allows reading and setting minimum utilization clamp values similar to the sched_setattr(2). This minimum utilization value is used to clamp the task specific minimum utilization clamp. The requested minimum utilization (protection) is always capped by the current value for the maximum utilization (limit), i.e. `cpu.uclamp.max`. h](j)}(hcpu.uclamp.minh]hcpu.uclamp.min}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh](h)}(hrA read-write single value file which exists on non-root cgroups. The default is "0", i.e. no utilization boosting.h]hvA read-write single value file which exists on non-root cgroups. The default is “0”, i.e. no utilization boosting.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hfThe requested minimum utilization (protection) as a percentage rational number, e.g. 12.34 for 12.34%.h]hfThe requested minimum utilization (protection) as a percentage rational number, e.g. 12.34 for 12.34%.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hThis interface allows reading and setting minimum utilization clamp values similar to the sched_setattr(2). This minimum utilization value is used to clamp the task specific minimum utilization clamp.h]hThis interface allows reading and setting minimum utilization clamp values similar to the sched_setattr(2). This minimum utilization value is used to clamp the task specific minimum utilization clamp.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hThe requested minimum utilization (protection) is always capped by the current value for the maximum utilization (limit), i.e. `cpu.uclamp.max`.h](hThe requested minimum utilization (protection) is always capped by the current value for the maximum utilization (limit), i.e. }(hjhhhNhNubhtitle_reference)}(h`cpu.uclamp.max`h]hcpu.uclamp.max}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1j!hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhj3ubj)}(hXcpu.uclamp.max A read-write single value file which exists on non-root cgroups. The default is "max". i.e. no utilization capping The requested maximum utilization (limit) as a percentage rational number, e.g. 98.76 for 98.76%. This interface allows reading and setting maximum utilization clamp values similar to the sched_setattr(2). This maximum utilization value is used to clamp the task specific maximum utilization clamp. h](j)}(hcpu.uclamp.maxh]hcpu.uclamp.max}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjGubj)}(hhh](h)}(hrA read-write single value file which exists on non-root cgroups. The default is "max". i.e. no utilization cappingh]hvA read-write single value file which exists on non-root cgroups. The default is “max”. i.e. no utilization capping}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjYubh)}(haThe requested maximum utilization (limit) as a percentage rational number, e.g. 98.76 for 98.76%.h]haThe requested maximum utilization (limit) as a percentage rational number, e.g. 98.76 for 98.76%.}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjYubh)}(hThis interface allows reading and setting maximum utilization clamp values similar to the sched_setattr(2). This maximum utilization value is used to clamp the task specific maximum utilization clamp.h]hThis interface allows reading and setting maximum utilization clamp values similar to the sched_setattr(2). This maximum utilization value is used to clamp the task specific maximum utilization clamp.}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjYubeh}(h]h ]h"]h$]h&]uh1jhjGubeh}(h]h ]h"]h$]h&]uh1jhhhMhj3ubj)}(hXcpu.idle A read-write single value file which exists on non-root cgroups. The default is 0. This is the cgroup analog of the per-task SCHED_IDLE sched policy. Setting this value to a 1 will make the scheduling policy of the cgroup SCHED_IDLE. The threads inside the cgroup will retain their own relative priorities, but the cgroup itself will be treated as very low priority relative to its peers. h](j)}(hcpu.idleh]hcpu.idle}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh](h)}(hRA read-write single value file which exists on non-root cgroups. The default is 0.h]hRA read-write single value file which exists on non-root cgroups. The default is 0.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hX1This is the cgroup analog of the per-task SCHED_IDLE sched policy. Setting this value to a 1 will make the scheduling policy of the cgroup SCHED_IDLE. The threads inside the cgroup will retain their own relative priorities, but the cgroup itself will be treated as very low priority relative to its peers.h]hX1This is the cgroup analog of the per-task SCHED_IDLE sched policy. Setting this value to a 1 will make the scheduling policy of the cgroup SCHED_IDLE. The threads inside the cgroup will retain their own relative priorities, but the cgroup itself will be treated as very low priority relative to its peers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhj3ubeh}(h]h ]h"]h$]h&]uh1jhj/ubah}(h]h ]h"]h$]h&]uh1jhhhMLhjhhubeh}(h]cpu-interface-filesah ]h"]cpu interface filesah$]h&]uh1hhjhhhhhMHubeh}(h](cpujeh ]h"](cpu cgroup-v2-cpueh$]h&]uh1hhjhhhhhM)j }jjsj }jjsubh)}(hhh](h)}(hMemoryh]hMemory}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hXThe "memory" controller regulates distribution of memory. Memory is stateful and implements both limit and protection models. Due to the intertwining between memory usage and reclaim pressure and the stateful nature of memory, the distribution model is relatively complex.h]hXThe “memory” controller regulates distribution of memory. Memory is stateful and implements both limit and protection models. Due to the intertwining between memory usage and reclaim pressure and the stateful nature of memory, the distribution model is relatively complex.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hWhile not completely water-tight, all major memory usages by a given cgroup are tracked so that the total memory consumption can be accounted and controlled to a reasonable extent. Currently, the following types of memory usages are tracked.h]hWhile not completely water-tight, all major memory usages by a given cgroup are tracked so that the total memory consumption can be accounted and controlled to a reasonable extent. Currently, the following types of memory usages are tracked.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj)}(hhh](j)}(h3Userland memory - page cache and anonymous memory. h]h)}(h2Userland memory - page cache and anonymous memory.h]h2Userland memory - page cache and anonymous memory.}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h4Kernel data structures such as dentries and inodes. h]h)}(h3Kernel data structures such as dentries and inodes.h]h3Kernel data structures such as dentries and inodes.}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj6ubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hTCP socket buffers. h]h)}(hTCP socket buffers.h]hTCP socket buffers.}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjNubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhMhjhhubh)}(h memory.reclaim Please note that the kernel can over or under reclaim from the target cgroup. If less bytes are reclaimed than the specified amount, -EAGAIN is returned. Please note that the proactive reclaim (triggered by this interface) is not meant to indicate memory pressure on the memory cgroup. Therefore socket memory balancing triggered by the memory reclaim normally is not exercised in this case. This means that the networking layer will not adapt based on reclaim induced by memory.reclaim. h]j)}(hhh](j)}(hmemory.current A read-only single value file which exists on non-root cgroups. The total amount of memory currently being used by the cgroup and its descendants. h](j)}(hmemory.currenth]hmemory.current}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh](h)}(h?A read-only single value file which exists on non-root cgroups.h]h?A read-only single value file which exists on non-root cgroups.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hRThe total amount of memory currently being used by the cgroup and its descendants.h]hRThe total amount of memory currently being used by the cgroup and its descendants.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hXmemory.min A read-write single value file which exists on non-root cgroups. The default is "0". Hard memory protection. If the memory usage of a cgroup is within its effective min boundary, the cgroup's memory won't be reclaimed under any conditions. If there is no unprotected reclaimable memory available, OOM killer is invoked. Above the effective min boundary (or effective low boundary if it is higher), pages are reclaimed proportionally to the overage, reducing reclaim pressure for smaller overages. Effective min boundary is limited by memory.min values of all ancestor cgroups. If there is memory.min overcommitment (child cgroup or cgroups are requiring more protected memory than parent will allow), then each child cgroup will get the part of parent's protection proportional to its actual memory usage below memory.min. Putting more memory than generally available under this protection is discouraged and may lead to constant OOMs. If a memory cgroup is not populated with processes, its memory.min is ignored. h](j)}(h memory.minh]h memory.min}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh](h)}(hUA read-write single value file which exists on non-root cgroups. The default is "0".h]hYA read-write single value file which exists on non-root cgroups. The default is “0”.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hXHard memory protection. If the memory usage of a cgroup is within its effective min boundary, the cgroup's memory won't be reclaimed under any conditions. If there is no unprotected reclaimable memory available, OOM killer is invoked. Above the effective min boundary (or effective low boundary if it is higher), pages are reclaimed proportionally to the overage, reducing reclaim pressure for smaller overages.h]hXHard memory protection. If the memory usage of a cgroup is within its effective min boundary, the cgroup’s memory won’t be reclaimed under any conditions. If there is no unprotected reclaimable memory available, OOM killer is invoked. Above the effective min boundary (or effective low boundary if it is higher), pages are reclaimed proportionally to the overage, reducing reclaim pressure for smaller overages.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hXEEffective min boundary is limited by memory.min values of all ancestor cgroups. If there is memory.min overcommitment (child cgroup or cgroups are requiring more protected memory than parent will allow), then each child cgroup will get the part of parent's protection proportional to its actual memory usage below memory.min.h]hXGEffective min boundary is limited by memory.min values of all ancestor cgroups. If there is memory.min overcommitment (child cgroup or cgroups are requiring more protected memory than parent will allow), then each child cgroup will get the part of parent’s protection proportional to its actual memory usage below memory.min.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hpPutting more memory than generally available under this protection is discouraged and may lead to constant OOMs.h]hpPutting more memory than generally available under this protection is discouraged and may lead to constant OOMs.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hNIf a memory cgroup is not populated with processes, its memory.min is ignored.h]hNIf a memory cgroup is not populated with processes, its memory.min is ignored.}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hXmemory.low A read-write single value file which exists on non-root cgroups. The default is "0". Best-effort memory protection. If the memory usage of a cgroup is within its effective low boundary, the cgroup's memory won't be reclaimed unless there is no reclaimable memory available in unprotected cgroups. Above the effective low boundary (or effective min boundary if it is higher), pages are reclaimed proportionally to the overage, reducing reclaim pressure for smaller overages. Effective low boundary is limited by memory.low values of all ancestor cgroups. If there is memory.low overcommitment (child cgroup or cgroups are requiring more protected memory than parent will allow), then each child cgroup will get the part of parent's protection proportional to its actual memory usage below memory.low. Putting more memory than generally available under this protection is discouraged. h](j)}(h memory.lowh]h memory.low}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjDubj)}(hhh](h)}(hUA read-write single value file which exists on non-root cgroups. The default is "0".h]hYA read-write single value file which exists on non-root cgroups. The default is “0”.}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjVubh)}(hXBest-effort memory protection. If the memory usage of a cgroup is within its effective low boundary, the cgroup's memory won't be reclaimed unless there is no reclaimable memory available in unprotected cgroups. Above the effective low boundary (or effective min boundary if it is higher), pages are reclaimed proportionally to the overage, reducing reclaim pressure for smaller overages.h]hXBest-effort memory protection. If the memory usage of a cgroup is within its effective low boundary, the cgroup’s memory won’t be reclaimed unless there is no reclaimable memory available in unprotected cgroups. Above the effective low boundary (or effective min boundary if it is higher), pages are reclaimed proportionally to the overage, reducing reclaim pressure for smaller overages.}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjVubh)}(hXEEffective low boundary is limited by memory.low values of all ancestor cgroups. If there is memory.low overcommitment (child cgroup or cgroups are requiring more protected memory than parent will allow), then each child cgroup will get the part of parent's protection proportional to its actual memory usage below memory.low.h]hXGEffective low boundary is limited by memory.low values of all ancestor cgroups. If there is memory.low overcommitment (child cgroup or cgroups are requiring more protected memory than parent will allow), then each child cgroup will get the part of parent’s protection proportional to its actual memory usage below memory.low.}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjVubh)}(hRPutting more memory than generally available under this protection is discouraged.h]hRPutting more memory than generally available under this protection is discouraged.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjVubeh}(h]h ]h"]h$]h&]uh1jhjDubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hXmemory.high A read-write single value file which exists on non-root cgroups. The default is "max". Memory usage throttle limit. If a cgroup's usage goes over the high boundary, the processes of the cgroup are throttled and put under heavy reclaim pressure. Going over the high limit never invokes the OOM killer and under extreme conditions the limit may be breached. The high limit should be used in scenarios where an external process monitors the limited cgroup to alleviate heavy reclaim pressure. h](j)}(h memory.highh]h memory.high}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh](h)}(hWA read-write single value file which exists on non-root cgroups. The default is "max".h]h[A read-write single value file which exists on non-root cgroups. The default is “max”.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjubh)}(hMemory usage throttle limit. If a cgroup's usage goes over the high boundary, the processes of the cgroup are throttled and put under heavy reclaim pressure.h]hMemory usage throttle limit. If a cgroup’s usage goes over the high boundary, the processes of the cgroup are throttled and put under heavy reclaim pressure.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjubh)}(hGoing over the high limit never invokes the OOM killer and under extreme conditions the limit may be breached. The high limit should be used in scenarios where an external process monitors the limited cgroup to alleviate heavy reclaim pressure.h]hGoing over the high limit never invokes the OOM killer and under extreme conditions the limit may be breached. The high limit should be used in scenarios where an external process monitors the limited cgroup to alleviate heavy reclaim pressure.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hXmemory.max A read-write single value file which exists on non-root cgroups. The default is "max". Memory usage hard limit. This is the main mechanism to limit memory usage of a cgroup. If a cgroup's memory usage reaches this limit and can't be reduced, the OOM killer is invoked in the cgroup. Under certain circumstances, the usage may go over the limit temporarily. In default configuration regular 0-order allocations always succeed unless OOM killer chooses current task as a victim. Some kinds of allocations don't invoke the OOM killer. Caller could retry them differently, return into userspace as -ENOMEM or silently ignore in cases like disk readahead. h](j)}(h memory.maxh]h memory.max}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM%hjubj)}(hhh](h)}(hWA read-write single value file which exists on non-root cgroups. The default is "max".h]h[A read-write single value file which exists on non-root cgroups. The default is “max”.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hXMemory usage hard limit. This is the main mechanism to limit memory usage of a cgroup. If a cgroup's memory usage reaches this limit and can't be reduced, the OOM killer is invoked in the cgroup. Under certain circumstances, the usage may go over the limit temporarily.h]hXMemory usage hard limit. This is the main mechanism to limit memory usage of a cgroup. If a cgroup’s memory usage reaches this limit and can’t be reduced, the OOM killer is invoked in the cgroup. Under certain circumstances, the usage may go over the limit temporarily.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hwIn default configuration regular 0-order allocations always succeed unless OOM killer chooses current task as a victim.h]hwIn default configuration regular 0-order allocations always succeed unless OOM killer chooses current task as a victim.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjubh)}(hSome kinds of allocations don't invoke the OOM killer. Caller could retry them differently, return into userspace as -ENOMEM or silently ignore in cases like disk readahead.h]hSome kinds of allocations don’t invoke the OOM killer. Caller could retry them differently, return into userspace as -ENOMEM or silently ignore in cases like disk readahead.}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM#hjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhM%hjubj)}(hXmemory.reclaim A write-only nested-keyed file which exists for all cgroups. This is a simple interface to trigger memory reclaim in the target cgroup. Example:: echo "1G" > memory.reclaim Please note that the kernel can over or under reclaim from the target cgroup. If less bytes are reclaimed than the specified amount, -EAGAIN is returned. Please note that the proactive reclaim (triggered by this interface) is not meant to indicate memory pressure on the memory cgroup. Therefore socket memory balancing triggered by the memory reclaim normally is not exercised in this case. This means that the networking layer will not adapt based on reclaim induced by memory.reclaim. h](j)}(hmemory.reclaimh]hmemory.reclaim}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM:hjAubj)}(hhh](h)}(h memory.reclaimh]hecho "1G" > memory.reclaim}hjsbah}(h]h ]h"]h$]h&]jjuh1jUhhhM/hjSubh)}(hPlease note that the kernel can over or under reclaim from the target cgroup. If less bytes are reclaimed than the specified amount, -EAGAIN is returned.h]hPlease note that the kernel can over or under reclaim from the target cgroup. If less bytes are reclaimed than the specified amount, -EAGAIN is returned.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM1hjSubh)}(hXMPlease note that the proactive reclaim (triggered by this interface) is not meant to indicate memory pressure on the memory cgroup. Therefore socket memory balancing triggered by the memory reclaim normally is not exercised in this case. This means that the networking layer will not adapt based on reclaim induced by memory.reclaim.h]hXMPlease note that the proactive reclaim (triggered by this interface) is not meant to indicate memory pressure on the memory cgroup. Therefore socket memory balancing triggered by the memory reclaim normally is not exercised in this case. This means that the networking layer will not adapt based on reclaim induced by memory.reclaim.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM5hjSubeh}(h]h ]h"]h$]h&]uh1jhjAubeh}(h]h ]h"]h$]h&]uh1jhhhM:hjubeh}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMhjzhhubh)}(h&The following nested keys are defined.h]h&The following nested keys are defined.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM<hjzhhubj)}(hX F ========== ================================ swappiness Swappiness value to reclaim with ========== ================================ Specifying a swappiness value instructs the kernel to perform the reclaim with that swappiness value. Note that this has the same semantics as vm.swappiness applied to memcg reclaim with all the existing limitations and potential future extensions. memory.peak A read-write single value file which exists on non-root cgroups. The max memory usage recorded for the cgroup and its descendants since either the creation of the cgroup or the most recent reset for that FD. A write of any non-empty string to this file resets it to the current memory usage for subsequent reads through the same file descriptor. memory.oom.group A read-write single value file which exists on non-root cgroups. The default value is "0". Determines whether the cgroup should be treated as an indivisible workload by the OOM killer. If set, all tasks belonging to the cgroup or to its descendants (if the memory cgroup is not a leaf cgroup) are killed together or not at all. This can be used to avoid partial kills to guarantee workload integrity. Tasks with the OOM protection (oom_score_adj set to -1000) are treated as an exception and are never killed. If the OOM killer is invoked in a cgroup, it's not going to kill any tasks outside of this cgroup, regardless memory.oom.group values of ancestor cgroups. memory.events A read-only flat-keyed file which exists on non-root cgroups. The following entries are defined. Unless specified otherwise, a value change in this file generates a file modified event. Note that all fields in this file are hierarchical and the file modified event can be generated due to an event down the hierarchy. For the local events at the cgroup level see memory.events.local. low The number of times the cgroup is reclaimed due to high memory pressure even though its usage is under the low boundary. This usually indicates that the low boundary is over-committed. high The number of times processes of the cgroup are throttled and routed to perform direct memory reclaim because the high memory boundary was exceeded. For a cgroup whose memory usage is capped by the high limit rather than global memory pressure, this event's occurrences are expected. max The number of times the cgroup's memory usage was about to go over the max boundary. If direct reclaim fails to bring it down, the cgroup goes to OOM state. oom The number of time the cgroup's memory usage was reached the limit and allocation was about to fail. This event is not raised if the OOM killer is not considered as an option, e.g. for failed high-order allocations or if caller asked to not retry attempts. oom_kill The number of processes belonging to this cgroup killed by any kind of OOM killer. oom_group_kill The number of times a group OOM has occurred. memory.events.local Similar to memory.events but the fields in the file are local to the cgroup i.e. not hierarchical. The file modified event generated on this file reflects only the local events. memory.stat A read-only flat-keyed file which exists on non-root cgroups. This breaks down the cgroup's memory footprint into different types of memory, type-specific details, and other information on the state and past events of the memory management system. All memory amounts are in bytes. The entries are ordered to be human readable, and new entries can show up in the middle. Don't rely on items remaining in a fixed position; use the keys to look up specific values! If the entry has no per-node counter (or not show in the memory.numa_stat). We use 'npn' (non-per-node) as the tag to indicate that it will not show in the memory.numa_stat. anon Amount of memory used in anonymous mappings such as brk(), sbrk(), and mmap(MAP_ANONYMOUS). Note that some kernel configurations might account complete larger allocations (e.g., THP) if only some, but not all the memory of such an allocation is mapped anymore. file Amount of memory used to cache filesystem data, including tmpfs and shared memory. kernel (npn) Amount of total kernel memory, including (kernel_stack, pagetables, percpu, vmalloc, slab) in addition to other kernel memory use cases. kernel_stack Amount of memory allocated to kernel stacks. pagetables Amount of memory allocated for page tables. sec_pagetables Amount of memory allocated for secondary page tables, this currently includes KVM mmu allocations on x86 and arm64 and IOMMU page tables. percpu (npn) Amount of memory used for storing per-cpu kernel data structures. sock (npn) Amount of memory used in network transmission buffers vmalloc (npn) Amount of memory used for vmap backed memory. shmem Amount of cached filesystem data that is swap-backed, such as tmpfs, shm segments, shared anonymous mmap()s zswap Amount of memory consumed by the zswap compression backend. zswapped Amount of application memory swapped out to zswap. file_mapped Amount of cached filesystem data mapped with mmap(). Note that some kernel configurations might account complete larger allocations (e.g., THP) if only some, but not not all the memory of such an allocation is mapped. file_dirty Amount of cached filesystem data that was modified but not yet written back to disk file_writeback Amount of cached filesystem data that was modified and is currently being written back to disk swapcached Amount of swap cached in memory. The swapcache is accounted against both memory and swap usage. anon_thp Amount of memory used in anonymous mappings backed by transparent hugepages file_thp Amount of cached filesystem data backed by transparent hugepages shmem_thp Amount of shm, tmpfs, shared anonymous mmap()s backed by transparent hugepages inactive_anon, active_anon, inactive_file, active_file, unevictable Amount of memory, swap-backed and filesystem-backed, on the internal memory management lists used by the page reclaim algorithm. As these represent internal list state (eg. shmem pages are on anon memory management lists), inactive_foo + active_foo may not be equal to the value for the foo counter, since the foo counter is type-based, not list-based. slab_reclaimable Part of "slab" that might be reclaimed, such as dentries and inodes. slab_unreclaimable Part of "slab" that cannot be reclaimed on memory pressure. slab (npn) Amount of memory used for storing in-kernel data structures. workingset_refault_anon Number of refaults of previously evicted anonymous pages. workingset_refault_file Number of refaults of previously evicted file pages. workingset_activate_anon Number of refaulted anonymous pages that were immediately activated. workingset_activate_file Number of refaulted file pages that were immediately activated. workingset_restore_anon Number of restored anonymous pages which have been detected as an active workingset before they got reclaimed. workingset_restore_file Number of restored file pages which have been detected as an active workingset before they got reclaimed. workingset_nodereclaim Number of times a shadow node has been reclaimed pswpin (npn) Number of pages swapped into memory pswpout (npn) Number of pages swapped out of memory pgscan (npn) Amount of scanned pages (in an inactive LRU list) pgsteal (npn) Amount of reclaimed pages pgscan_kswapd (npn) Amount of scanned pages by kswapd (in an inactive LRU list) pgscan_direct (npn) Amount of scanned pages directly (in an inactive LRU list) pgscan_khugepaged (npn) Amount of scanned pages by khugepaged (in an inactive LRU list) pgscan_proactive (npn) Amount of scanned pages proactively (in an inactive LRU list) pgsteal_kswapd (npn) Amount of reclaimed pages by kswapd pgsteal_direct (npn) Amount of reclaimed pages directly pgsteal_khugepaged (npn) Amount of reclaimed pages by khugepaged pgsteal_proactive (npn) Amount of reclaimed pages proactively pgfault (npn) Total number of page faults incurred pgmajfault (npn) Number of major page faults incurred pgrefill (npn) Amount of scanned pages (in an active LRU list) pgactivate (npn) Amount of pages moved to the active LRU list pgdeactivate (npn) Amount of pages moved to the inactive LRU list pglazyfree (npn) Amount of pages postponed to be freed under memory pressure pglazyfreed (npn) Amount of reclaimed lazyfree pages swpin_zero Number of pages swapped into memory and filled with zero, where I/O was optimized out because the page content was detected to be zero during swapout. swpout_zero Number of zero-filled pages swapped out with I/O skipped due to the content being detected as zero. zswpin Number of pages moved in to memory from zswap. zswpout Number of pages moved out of memory to zswap. zswpwb Number of pages written from zswap to swap. thp_fault_alloc (npn) Number of transparent hugepages which were allocated to satisfy a page fault. This counter is not present when CONFIG_TRANSPARENT_HUGEPAGE is not set. thp_collapse_alloc (npn) Number of transparent hugepages which were allocated to allow collapsing an existing range of pages. This counter is not present when CONFIG_TRANSPARENT_HUGEPAGE is not set. thp_swpout (npn) Number of transparent hugepages which are swapout in one piece without splitting. thp_swpout_fallback (npn) Number of transparent hugepages which were split before swapout. Usually because failed to allocate some continuous swap space for the huge page. numa_pages_migrated (npn) Number of pages migrated by NUMA balancing. numa_pte_updates (npn) Number of pages whose page table entries are modified by NUMA balancing to produce NUMA hinting faults on access. numa_hint_faults (npn) Number of NUMA hinting faults. pgdemote_kswapd Number of pages demoted by kswapd. pgdemote_direct Number of pages demoted directly. pgdemote_khugepaged Number of pages demoted by khugepaged. pgdemote_proactive Number of pages demoted by proactively. hugetlb Amount of memory used by hugetlb pages. This metric only shows up if hugetlb usage is accounted for in memory.current (i.e. cgroup is mounted with the memory_hugetlb_accounting option). memory.numa_stat A read-only nested-keyed file which exists on non-root cgroups. This breaks down the cgroup's memory footprint into different types of memory, type-specific details, and other information per node on the state of the memory management system. This is useful for providing visibility into the NUMA locality information within an memcg since the pages are allowed to be allocated from any physical node. One of the use case is evaluating application performance by combining this information with the application's CPU allocation. All memory amounts are in bytes. The output format of memory.numa_stat is:: type N0= N1= ... The entries are ordered to be human readable, and new entries can show up in the middle. Don't rely on items remaining in a fixed position; use the keys to look up specific values! The entries can refer to the memory.stat. memory.swap.current A read-only single value file which exists on non-root cgroups. The total amount of swap currently being used by the cgroup and its descendants. memory.swap.high A read-write single value file which exists on non-root cgroups. The default is "max". Swap usage throttle limit. If a cgroup's swap usage exceeds this limit, all its further allocations will be throttled to allow userspace to implement custom out-of-memory procedures. This limit marks a point of no return for the cgroup. It is NOT designed to manage the amount of swapping a workload does during regular operation. Compare to memory.swap.max, which prohibits swapping past a set amount, but lets the cgroup continue unimpeded as long as other memory can be reclaimed. Healthy workloads are not expected to reach this limit. memory.swap.peak A read-write single value file which exists on non-root cgroups. The max swap usage recorded for the cgroup and its descendants since the creation of the cgroup or the most recent reset for that FD. A write of any non-empty string to this file resets it to the current memory usage for subsequent reads through the same file descriptor. memory.swap.max A read-write single value file which exists on non-root cgroups. The default is "max". Swap usage hard limit. If a cgroup's swap usage reaches this limit, anonymous memory of the cgroup will not be swapped out. memory.swap.events A read-only flat-keyed file which exists on non-root cgroups. The following entries are defined. Unless specified otherwise, a value change in this file generates a file modified event. high The number of times the cgroup's swap usage was over the high threshold. max The number of times the cgroup's swap usage was about to go over the max boundary and swap allocation failed. fail The number of times swap allocation failed either because of running out of swap system-wide or max limit. When reduced under the current usage, the existing swap entries are reclaimed gradually and the swap usage may stay higher than the limit for an extended period of time. This reduces the impact on the workload and memory management. memory.zswap.current A read-only single value file which exists on non-root cgroups. The total amount of memory consumed by the zswap compression backend. memory.zswap.max A read-write single value file which exists on non-root cgroups. The default is "max". Zswap usage hard limit. If a cgroup's zswap pool reaches this limit, it will refuse to take any more stores before existing entries fault back in or are written out to disk. memory.zswap.writeback A read-write single value file. The default value is "1". Note that this setting is hierarchical, i.e. the writeback would be implicitly disabled for child cgroups if the upper hierarchy does so. When this is set to 0, all swapping attempts to swapping devices are disabled. This included both zswap writebacks, and swapping due to zswap store failures. If the zswap store failures are recurring (for e.g if the pages are incompressible), users can observe reclaim inefficiency after disabling writeback (because the same pages might be rejected again and again). Note that this is subtly different from setting memory.swap.max to 0, as it still allows for pages to be written to the zswap pool. This setting has no effect if zswap is disabled, and swapping is allowed unless memory.swap.max is set to 0. memory.pressure A read-only nested-keyed file. Shows pressure stall information for memory. See :ref:`Documentation/accounting/psi.rst ` for details. h](j)}(hX ========== ================================ swappiness Swappiness value to reclaim with ========== ================================ Specifying a swappiness value instructs the kernel to perform the reclaim with that swappiness value. Note that this has the same semantics as vm.swappiness applied to memcg reclaim with all the existing limitations and potential future extensions. h](j)}(h========== ================================ swappiness Swappiness value to reclaim with ========== ================================ h]htable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jhjubhtbody)}(hhh]hrow)}(hhh](hentry)}(hhh]h)}(h swappinessh]h swappiness}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM?hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h Swappiness value to reclaim withh]h Swappiness value to reclaim with}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM?hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhM>hjubh)}(hSpecifying a swappiness value instructs the kernel to perform the reclaim with that swappiness value. Note that this has the same semantics as vm.swappiness applied to memcg reclaim with all the existing limitations and potential future extensions.h]hSpecifying a swappiness value instructs the kernel to perform the reclaim with that swappiness value. Note that this has the same semantics as vm.swappiness applied to memcg reclaim with all the existing limitations and potential future extensions.}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMBhjubeh}(h]h ]h"]h$]h&]uh1jhhhM>hjubj)}(hhh](j)}(hXhmemory.peak A read-write single value file which exists on non-root cgroups. The max memory usage recorded for the cgroup and its descendants since either the creation of the cgroup or the most recent reset for that FD. A write of any non-empty string to this file resets it to the current memory usage for subsequent reads through the same file descriptor. h](j)}(h memory.peakh]h memory.peak}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMOhjlubj)}(hhh](h)}(h@A read-write single value file which exists on non-root cgroups.h]h@A read-write single value file which exists on non-root cgroups.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMHhj~ubh)}(hThe max memory usage recorded for the cgroup and its descendants since either the creation of the cgroup or the most recent reset for that FD.h]hThe max memory usage recorded for the cgroup and its descendants since either the creation of the cgroup or the most recent reset for that FD.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMJhj~ubh)}(hA write of any non-empty string to this file resets it to the current memory usage for subsequent reads through the same file descriptor.h]hA write of any non-empty string to this file resets it to the current memory usage for subsequent reads through the same file descriptor.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMMhj~ubeh}(h]h ]h"]h$]h&]uh1jhjlubeh}(h]h ]h"]h$]h&]uh1jhhhMOhjiubj)}(hXmemory.oom.group A read-write single value file which exists on non-root cgroups. The default value is "0". Determines whether the cgroup should be treated as an indivisible workload by the OOM killer. If set, all tasks belonging to the cgroup or to its descendants (if the memory cgroup is not a leaf cgroup) are killed together or not at all. This can be used to avoid partial kills to guarantee workload integrity. Tasks with the OOM protection (oom_score_adj set to -1000) are treated as an exception and are never killed. If the OOM killer is invoked in a cgroup, it's not going to kill any tasks outside of this cgroup, regardless memory.oom.group values of ancestor cgroups. h](j)}(hmemory.oom.grouph]hmemory.oom.group}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMahjubj)}(hhh](h)}(h[A read-write single value file which exists on non-root cgroups. The default value is "0".h]h_A read-write single value file which exists on non-root cgroups. The default value is “0”.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMRhjubh)}(hX5Determines whether the cgroup should be treated as an indivisible workload by the OOM killer. If set, all tasks belonging to the cgroup or to its descendants (if the memory cgroup is not a leaf cgroup) are killed together or not at all. This can be used to avoid partial kills to guarantee workload integrity.h]hX5Determines whether the cgroup should be treated as an indivisible workload by the OOM killer. If set, all tasks belonging to the cgroup or to its descendants (if the memory cgroup is not a leaf cgroup) are killed together or not at all. This can be used to avoid partial kills to guarantee workload integrity.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMUhjubh)}(hlTasks with the OOM protection (oom_score_adj set to -1000) are treated as an exception and are never killed.h]hlTasks with the OOM protection (oom_score_adj set to -1000) are treated as an exception and are never killed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM\hjubh)}(hIf the OOM killer is invoked in a cgroup, it's not going to kill any tasks outside of this cgroup, regardless memory.oom.group values of ancestor cgroups.h]hIf the OOM killer is invoked in a cgroup, it’s not going to kill any tasks outside of this cgroup, regardless memory.oom.group values of ancestor cgroups.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM_hjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMahjiubj)}(hXkmemory.events A read-only flat-keyed file which exists on non-root cgroups. The following entries are defined. Unless specified otherwise, a value change in this file generates a file modified event. Note that all fields in this file are hierarchical and the file modified event can be generated due to an event down the hierarchy. For the local events at the cgroup level see memory.events.local. low The number of times the cgroup is reclaimed due to high memory pressure even though its usage is under the low boundary. This usually indicates that the low boundary is over-committed. high The number of times processes of the cgroup are throttled and routed to perform direct memory reclaim because the high memory boundary was exceeded. For a cgroup whose memory usage is capped by the high limit rather than global memory pressure, this event's occurrences are expected. max The number of times the cgroup's memory usage was about to go over the max boundary. If direct reclaim fails to bring it down, the cgroup goes to OOM state. oom The number of time the cgroup's memory usage was reached the limit and allocation was about to fail. This event is not raised if the OOM killer is not considered as an option, e.g. for failed high-order allocations or if caller asked to not retry attempts. oom_kill The number of processes belonging to this cgroup killed by any kind of OOM killer. oom_group_kill The number of times a group OOM has occurred. h](j)}(h memory.eventsh]h memory.events}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh](h)}(hA read-only flat-keyed file which exists on non-root cgroups. The following entries are defined. Unless specified otherwise, a value change in this file generates a file modified event.h]hA read-only flat-keyed file which exists on non-root cgroups. The following entries are defined. Unless specified otherwise, a value change in this file generates a file modified event.}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMdhj"ubh)}(hNote that all fields in this file are hierarchical and the file modified event can be generated due to an event down the hierarchy. For the local events at the cgroup level see memory.events.local.h]hNote that all fields in this file are hierarchical and the file modified event can be generated due to an event down the hierarchy. For the local events at the cgroup level see memory.events.local.}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMihj"ubj)}(hXlow The number of times the cgroup is reclaimed due to high memory pressure even though its usage is under the low boundary. This usually indicates that the low boundary is over-committed. high The number of times processes of the cgroup are throttled and routed to perform direct memory reclaim because the high memory boundary was exceeded. For a cgroup whose memory usage is capped by the high limit rather than global memory pressure, this event's occurrences are expected. max The number of times the cgroup's memory usage was about to go over the max boundary. If direct reclaim fails to bring it down, the cgroup goes to OOM state. oom The number of time the cgroup's memory usage was reached the limit and allocation was about to fail. This event is not raised if the OOM killer is not considered as an option, e.g. for failed high-order allocations or if caller asked to not retry attempts. oom_kill The number of processes belonging to this cgroup killed by any kind of OOM killer. oom_group_kill The number of times a group OOM has occurred. h]j)}(hhh](j)}(hlow The number of times the cgroup is reclaimed due to high memory pressure even though its usage is under the low boundary. This usually indicates that the low boundary is over-committed. h](j)}(hlowh]hlow}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMrhjHubj)}(hhh]h)}(hThe number of times the cgroup is reclaimed due to high memory pressure even though its usage is under the low boundary. This usually indicates that the low boundary is over-committed.h]hThe number of times the cgroup is reclaimed due to high memory pressure even though its usage is under the low boundary. This usually indicates that the low boundary is over-committed.}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMohjZubah}(h]h ]h"]h$]h&]uh1jhjHubeh}(h]h ]h"]h$]h&]uh1jhhhMrhjEubj)}(hX"high The number of times processes of the cgroup are throttled and routed to perform direct memory reclaim because the high memory boundary was exceeded. For a cgroup whose memory usage is capped by the high limit rather than global memory pressure, this event's occurrences are expected. h](j)}(hhighh]hhigh}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMzhjwubj)}(hhh]h)}(hXThe number of times processes of the cgroup are throttled and routed to perform direct memory reclaim because the high memory boundary was exceeded. For a cgroup whose memory usage is capped by the high limit rather than global memory pressure, this event's occurrences are expected.h]hXThe number of times processes of the cgroup are throttled and routed to perform direct memory reclaim because the high memory boundary was exceeded. For a cgroup whose memory usage is capped by the high limit rather than global memory pressure, this event’s occurrences are expected.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMuhjubah}(h]h ]h"]h$]h&]uh1jhjwubeh}(h]h ]h"]h$]h&]uh1jhhhMzhjEubj)}(hmax The number of times the cgroup's memory usage was about to go over the max boundary. If direct reclaim fails to bring it down, the cgroup goes to OOM state. h](j)}(hmaxh]hmax}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh]h)}(hThe number of times the cgroup's memory usage was about to go over the max boundary. If direct reclaim fails to bring it down, the cgroup goes to OOM state.h]hThe number of times the cgroup’s memory usage was about to go over the max boundary. If direct reclaim fails to bring it down, the cgroup goes to OOM state.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM}hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjEubj)}(hXoom The number of time the cgroup's memory usage was reached the limit and allocation was about to fail. This event is not raised if the OOM killer is not considered as an option, e.g. for failed high-order allocations or if caller asked to not retry attempts. h](j)}(hoomh]hoom}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh](h)}(hdThe number of time the cgroup's memory usage was reached the limit and allocation was about to fail.h]hfThe number of time the cgroup’s memory usage was reached the limit and allocation was about to fail.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hThis event is not raised if the OOM killer is not considered as an option, e.g. for failed high-order allocations or if caller asked to not retry attempts.h]hThis event is not raised if the OOM killer is not considered as an option, e.g. for failed high-order allocations or if caller asked to not retry attempts.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjEubj)}(h\oom_kill The number of processes belonging to this cgroup killed by any kind of OOM killer. h](j)}(hoom_killh]hoom_kill}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh]h)}(hRThe number of processes belonging to this cgroup killed by any kind of OOM killer.h]hRThe number of processes belonging to this cgroup killed by any kind of OOM killer.}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj$ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjEubj)}(h=oom_group_kill The number of times a group OOM has occurred. h](j)}(hoom_group_killh]hoom_group_kill}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjAubj)}(hhh]h)}(h-The number of times a group OOM has occurred.h]h-The number of times a group OOM has occurred.}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjSubah}(h]h ]h"]h$]h&]uh1jhjAubeh}(h]h ]h"]h$]h&]uh1jhhhMhjEubeh}(h]h ]h"]h$]h&]uh1jhjAubah}(h]h ]h"]h$]h&]uh1jhhhMnhj"ubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjiubj)}(hmemory.events.local Similar to memory.events but the fields in the file are local to the cgroup i.e. not hierarchical. The file modified event generated on this file reflects only the local events. h](j)}(hmemory.events.localh]hmemory.events.local}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh]h)}(hSimilar to memory.events but the fields in the file are local to the cgroup i.e. not hierarchical. The file modified event generated on this file reflects only the local events.h]hSimilar to memory.events but the fields in the file are local to the cgroup i.e. not hierarchical. The file modified event generated on this file reflects only the local events.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjiubj)}(hXbmemory.stat A read-only flat-keyed file which exists on non-root cgroups. This breaks down the cgroup's memory footprint into different types of memory, type-specific details, and other information on the state and past events of the memory management system. All memory amounts are in bytes. The entries are ordered to be human readable, and new entries can show up in the middle. Don't rely on items remaining in a fixed position; use the keys to look up specific values! If the entry has no per-node counter (or not show in the memory.numa_stat). We use 'npn' (non-per-node) as the tag to indicate that it will not show in the memory.numa_stat. anon Amount of memory used in anonymous mappings such as brk(), sbrk(), and mmap(MAP_ANONYMOUS). Note that some kernel configurations might account complete larger allocations (e.g., THP) if only some, but not all the memory of such an allocation is mapped anymore. file Amount of memory used to cache filesystem data, including tmpfs and shared memory. kernel (npn) Amount of total kernel memory, including (kernel_stack, pagetables, percpu, vmalloc, slab) in addition to other kernel memory use cases. kernel_stack Amount of memory allocated to kernel stacks. pagetables Amount of memory allocated for page tables. sec_pagetables Amount of memory allocated for secondary page tables, this currently includes KVM mmu allocations on x86 and arm64 and IOMMU page tables. percpu (npn) Amount of memory used for storing per-cpu kernel data structures. sock (npn) Amount of memory used in network transmission buffers vmalloc (npn) Amount of memory used for vmap backed memory. shmem Amount of cached filesystem data that is swap-backed, such as tmpfs, shm segments, shared anonymous mmap()s zswap Amount of memory consumed by the zswap compression backend. zswapped Amount of application memory swapped out to zswap. file_mapped Amount of cached filesystem data mapped with mmap(). Note that some kernel configurations might account complete larger allocations (e.g., THP) if only some, but not not all the memory of such an allocation is mapped. file_dirty Amount of cached filesystem data that was modified but not yet written back to disk file_writeback Amount of cached filesystem data that was modified and is currently being written back to disk swapcached Amount of swap cached in memory. The swapcache is accounted against both memory and swap usage. anon_thp Amount of memory used in anonymous mappings backed by transparent hugepages file_thp Amount of cached filesystem data backed by transparent hugepages shmem_thp Amount of shm, tmpfs, shared anonymous mmap()s backed by transparent hugepages inactive_anon, active_anon, inactive_file, active_file, unevictable Amount of memory, swap-backed and filesystem-backed, on the internal memory management lists used by the page reclaim algorithm. As these represent internal list state (eg. shmem pages are on anon memory management lists), inactive_foo + active_foo may not be equal to the value for the foo counter, since the foo counter is type-based, not list-based. slab_reclaimable Part of "slab" that might be reclaimed, such as dentries and inodes. slab_unreclaimable Part of "slab" that cannot be reclaimed on memory pressure. slab (npn) Amount of memory used for storing in-kernel data structures. workingset_refault_anon Number of refaults of previously evicted anonymous pages. workingset_refault_file Number of refaults of previously evicted file pages. workingset_activate_anon Number of refaulted anonymous pages that were immediately activated. workingset_activate_file Number of refaulted file pages that were immediately activated. workingset_restore_anon Number of restored anonymous pages which have been detected as an active workingset before they got reclaimed. workingset_restore_file Number of restored file pages which have been detected as an active workingset before they got reclaimed. workingset_nodereclaim Number of times a shadow node has been reclaimed pswpin (npn) Number of pages swapped into memory pswpout (npn) Number of pages swapped out of memory pgscan (npn) Amount of scanned pages (in an inactive LRU list) pgsteal (npn) Amount of reclaimed pages pgscan_kswapd (npn) Amount of scanned pages by kswapd (in an inactive LRU list) pgscan_direct (npn) Amount of scanned pages directly (in an inactive LRU list) pgscan_khugepaged (npn) Amount of scanned pages by khugepaged (in an inactive LRU list) pgscan_proactive (npn) Amount of scanned pages proactively (in an inactive LRU list) pgsteal_kswapd (npn) Amount of reclaimed pages by kswapd pgsteal_direct (npn) Amount of reclaimed pages directly pgsteal_khugepaged (npn) Amount of reclaimed pages by khugepaged pgsteal_proactive (npn) Amount of reclaimed pages proactively pgfault (npn) Total number of page faults incurred pgmajfault (npn) Number of major page faults incurred pgrefill (npn) Amount of scanned pages (in an active LRU list) pgactivate (npn) Amount of pages moved to the active LRU list pgdeactivate (npn) Amount of pages moved to the inactive LRU list pglazyfree (npn) Amount of pages postponed to be freed under memory pressure pglazyfreed (npn) Amount of reclaimed lazyfree pages swpin_zero Number of pages swapped into memory and filled with zero, where I/O was optimized out because the page content was detected to be zero during swapout. swpout_zero Number of zero-filled pages swapped out with I/O skipped due to the content being detected as zero. zswpin Number of pages moved in to memory from zswap. zswpout Number of pages moved out of memory to zswap. zswpwb Number of pages written from zswap to swap. thp_fault_alloc (npn) Number of transparent hugepages which were allocated to satisfy a page fault. This counter is not present when CONFIG_TRANSPARENT_HUGEPAGE is not set. thp_collapse_alloc (npn) Number of transparent hugepages which were allocated to allow collapsing an existing range of pages. This counter is not present when CONFIG_TRANSPARENT_HUGEPAGE is not set. thp_swpout (npn) Number of transparent hugepages which are swapout in one piece without splitting. thp_swpout_fallback (npn) Number of transparent hugepages which were split before swapout. Usually because failed to allocate some continuous swap space for the huge page. numa_pages_migrated (npn) Number of pages migrated by NUMA balancing. numa_pte_updates (npn) Number of pages whose page table entries are modified by NUMA balancing to produce NUMA hinting faults on access. numa_hint_faults (npn) Number of NUMA hinting faults. pgdemote_kswapd Number of pages demoted by kswapd. pgdemote_direct Number of pages demoted directly. pgdemote_khugepaged Number of pages demoted by khugepaged. pgdemote_proactive Number of pages demoted by proactively. hugetlb Amount of memory used by hugetlb pages. This metric only shows up if hugetlb usage is accounted for in memory.current (i.e. cgroup is mounted with the memory_hugetlb_accounting option). h](j)}(h memory.stath]h memory.stat}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh](h)}(h=A read-only flat-keyed file which exists on non-root cgroups.h]h=A read-only flat-keyed file which exists on non-root cgroups.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hThis breaks down the cgroup's memory footprint into different types of memory, type-specific details, and other information on the state and past events of the memory management system.h]hThis breaks down the cgroup’s memory footprint into different types of memory, type-specific details, and other information on the state and past events of the memory management system.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(h All memory amounts are in bytes.h]h All memory amounts are in bytes.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hThe entries are ordered to be human readable, and new entries can show up in the middle. Don't rely on items remaining in a fixed position; use the keys to look up specific values!h]hThe entries are ordered to be human readable, and new entries can show up in the middle. Don’t rely on items remaining in a fixed position; use the keys to look up specific values!}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hIf the entry has no per-node counter (or not show in the memory.numa_stat). We use 'npn' (non-per-node) as the tag to indicate that it will not show in the memory.numa_stat.h]hIf the entry has no per-node counter (or not show in the memory.numa_stat). We use ‘npn’ (non-per-node) as the tag to indicate that it will not show in the memory.numa_stat.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hXsanon Amount of memory used in anonymous mappings such as brk(), sbrk(), and mmap(MAP_ANONYMOUS). Note that some kernel configurations might account complete larger allocations (e.g., THP) if only some, but not all the memory of such an allocation is mapped anymore. file Amount of memory used to cache filesystem data, including tmpfs and shared memory. kernel (npn) Amount of total kernel memory, including (kernel_stack, pagetables, percpu, vmalloc, slab) in addition to other kernel memory use cases. kernel_stack Amount of memory allocated to kernel stacks. pagetables Amount of memory allocated for page tables. sec_pagetables Amount of memory allocated for secondary page tables, this currently includes KVM mmu allocations on x86 and arm64 and IOMMU page tables. percpu (npn) Amount of memory used for storing per-cpu kernel data structures. sock (npn) Amount of memory used in network transmission buffers vmalloc (npn) Amount of memory used for vmap backed memory. shmem Amount of cached filesystem data that is swap-backed, such as tmpfs, shm segments, shared anonymous mmap()s zswap Amount of memory consumed by the zswap compression backend. zswapped Amount of application memory swapped out to zswap. file_mapped Amount of cached filesystem data mapped with mmap(). Note that some kernel configurations might account complete larger allocations (e.g., THP) if only some, but not not all the memory of such an allocation is mapped. file_dirty Amount of cached filesystem data that was modified but not yet written back to disk file_writeback Amount of cached filesystem data that was modified and is currently being written back to disk swapcached Amount of swap cached in memory. The swapcache is accounted against both memory and swap usage. anon_thp Amount of memory used in anonymous mappings backed by transparent hugepages file_thp Amount of cached filesystem data backed by transparent hugepages shmem_thp Amount of shm, tmpfs, shared anonymous mmap()s backed by transparent hugepages inactive_anon, active_anon, inactive_file, active_file, unevictable Amount of memory, swap-backed and filesystem-backed, on the internal memory management lists used by the page reclaim algorithm. As these represent internal list state (eg. shmem pages are on anon memory management lists), inactive_foo + active_foo may not be equal to the value for the foo counter, since the foo counter is type-based, not list-based. slab_reclaimable Part of "slab" that might be reclaimed, such as dentries and inodes. slab_unreclaimable Part of "slab" that cannot be reclaimed on memory pressure. slab (npn) Amount of memory used for storing in-kernel data structures. workingset_refault_anon Number of refaults of previously evicted anonymous pages. workingset_refault_file Number of refaults of previously evicted file pages. workingset_activate_anon Number of refaulted anonymous pages that were immediately activated. workingset_activate_file Number of refaulted file pages that were immediately activated. workingset_restore_anon Number of restored anonymous pages which have been detected as an active workingset before they got reclaimed. workingset_restore_file Number of restored file pages which have been detected as an active workingset before they got reclaimed. workingset_nodereclaim Number of times a shadow node has been reclaimed pswpin (npn) Number of pages swapped into memory pswpout (npn) Number of pages swapped out of memory pgscan (npn) Amount of scanned pages (in an inactive LRU list) pgsteal (npn) Amount of reclaimed pages pgscan_kswapd (npn) Amount of scanned pages by kswapd (in an inactive LRU list) pgscan_direct (npn) Amount of scanned pages directly (in an inactive LRU list) pgscan_khugepaged (npn) Amount of scanned pages by khugepaged (in an inactive LRU list) pgscan_proactive (npn) Amount of scanned pages proactively (in an inactive LRU list) pgsteal_kswapd (npn) Amount of reclaimed pages by kswapd pgsteal_direct (npn) Amount of reclaimed pages directly pgsteal_khugepaged (npn) Amount of reclaimed pages by khugepaged pgsteal_proactive (npn) Amount of reclaimed pages proactively pgfault (npn) Total number of page faults incurred pgmajfault (npn) Number of major page faults incurred pgrefill (npn) Amount of scanned pages (in an active LRU list) pgactivate (npn) Amount of pages moved to the active LRU list pgdeactivate (npn) Amount of pages moved to the inactive LRU list pglazyfree (npn) Amount of pages postponed to be freed under memory pressure pglazyfreed (npn) Amount of reclaimed lazyfree pages swpin_zero Number of pages swapped into memory and filled with zero, where I/O was optimized out because the page content was detected to be zero during swapout. swpout_zero Number of zero-filled pages swapped out with I/O skipped due to the content being detected as zero. zswpin Number of pages moved in to memory from zswap. zswpout Number of pages moved out of memory to zswap. zswpwb Number of pages written from zswap to swap. thp_fault_alloc (npn) Number of transparent hugepages which were allocated to satisfy a page fault. This counter is not present when CONFIG_TRANSPARENT_HUGEPAGE is not set. thp_collapse_alloc (npn) Number of transparent hugepages which were allocated to allow collapsing an existing range of pages. This counter is not present when CONFIG_TRANSPARENT_HUGEPAGE is not set. thp_swpout (npn) Number of transparent hugepages which are swapout in one piece without splitting. thp_swpout_fallback (npn) Number of transparent hugepages which were split before swapout. Usually because failed to allocate some continuous swap space for the huge page. numa_pages_migrated (npn) Number of pages migrated by NUMA balancing. numa_pte_updates (npn) Number of pages whose page table entries are modified by NUMA balancing to produce NUMA hinting faults on access. numa_hint_faults (npn) Number of NUMA hinting faults. pgdemote_kswapd Number of pages demoted by kswapd. pgdemote_direct Number of pages demoted directly. pgdemote_khugepaged Number of pages demoted by khugepaged. pgdemote_proactive Number of pages demoted by proactively. hugetlb Amount of memory used by hugetlb pages. This metric only shows up if hugetlb usage is accounted for in memory.current (i.e. cgroup is mounted with the memory_hugetlb_accounting option). h]j)}(hhh](j)}(hX anon Amount of memory used in anonymous mappings such as brk(), sbrk(), and mmap(MAP_ANONYMOUS). Note that some kernel configurations might account complete larger allocations (e.g., THP) if only some, but not all the memory of such an allocation is mapped anymore. h](j)}(hanonh]hanon}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh]h)}(hXAmount of memory used in anonymous mappings such as brk(), sbrk(), and mmap(MAP_ANONYMOUS). Note that some kernel configurations might account complete larger allocations (e.g., THP) if only some, but not all the memory of such an allocation is mapped anymore.h]hXAmount of memory used in anonymous mappings such as brk(), sbrk(), and mmap(MAP_ANONYMOUS). Note that some kernel configurations might account complete larger allocations (e.g., THP) if only some, but not all the memory of such an allocation is mapped anymore.}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hXfile Amount of memory used to cache filesystem data, including tmpfs and shared memory. h](j)}(hfileh]hfile}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjHubj)}(hhh]h)}(hRAmount of memory used to cache filesystem data, including tmpfs and shared memory.h]hRAmount of memory used to cache filesystem data, including tmpfs and shared memory.}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjZubah}(h]h ]h"]h$]h&]uh1jhjHubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hkernel (npn) Amount of total kernel memory, including (kernel_stack, pagetables, percpu, vmalloc, slab) in addition to other kernel memory use cases. h](j)}(h kernel (npn)h]h kernel (npn)}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjwubj)}(hhh]h)}(hAmount of total kernel memory, including (kernel_stack, pagetables, percpu, vmalloc, slab) in addition to other kernel memory use cases.h]hAmount of total kernel memory, including (kernel_stack, pagetables, percpu, vmalloc, slab) in addition to other kernel memory use cases.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjwubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(h:kernel_stack Amount of memory allocated to kernel stacks. h](j)}(h kernel_stackh]h kernel_stack}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh]h)}(h,Amount of memory allocated to kernel stacks.h]h,Amount of memory allocated to kernel stacks.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(h7pagetables Amount of memory allocated for page tables. h](j)}(h pagetablesh]h pagetables}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh]h)}(h+Amount of memory allocated for page tables.h]h+Amount of memory allocated for page tables.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hsec_pagetables Amount of memory allocated for secondary page tables, this currently includes KVM mmu allocations on x86 and arm64 and IOMMU page tables. h](j)}(hsec_pagetablesh]hsec_pagetables}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhh]h)}(hAmount of memory allocated for secondary page tables, this currently includes KVM mmu allocations on x86 and arm64 and IOMMU page tables.h]hAmount of memory allocated for secondary page tables, this currently includes KVM mmu allocations on x86 and arm64 and IOMMU page tables.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hOpercpu (npn) Amount of memory used for storing per-cpu kernel data structures. h](j)}(h percpu (npn)h]h percpu (npn)}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj3ubj)}(hhh]h)}(hAAmount of memory used for storing per-cpu kernel data structures.h]hAAmount of memory used for storing per-cpu kernel data structures.}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjEubah}(h]h ]h"]h$]h&]uh1jhj3ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hAsock (npn) Amount of memory used in network transmission buffers h](j)}(h sock (npn)h]h sock (npn)}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjbubj)}(hhh]h)}(h5Amount of memory used in network transmission buffersh]h5Amount of memory used in network transmission buffers}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjtubah}(h]h ]h"]h$]h&]uh1jhjbubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hpgsteal_proactive (npn) Amount of reclaimed pages proactively h](j)}(hpgsteal_proactive (npn)h]hpgsteal_proactive (npn)}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMChj%ubj)}(hhh]h)}(h%Amount of reclaimed pages proactivelyh]h%Amount of reclaimed pages proactively}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMChj%ubah}(h]h ]h"]h$]h&]uh1jhj%ubeh}(h]h ]h"]h$]h&]uh1jhhhMChjubj)}(h3pgfault (npn) Total number of page faults incurred h](j)}(h pgfault (npn)h]h pgfault (npn)}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMFhj%ubj)}(hhh]h)}(h$Total number of page faults incurredh]h$Total number of page faults incurred}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMFhj%ubah}(h]h ]h"]h$]h&]uh1jhj%ubeh}(h]h ]h"]h$]h&]uh1jhhhMFhjubj)}(h6pgmajfault (npn) Number of major page faults incurred h](j)}(hpgmajfault (npn)h]hpgmajfault (npn)}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMIhj &ubj)}(hhh]h)}(h$Number of major page faults incurredh]h$Number of major page faults incurred}(hj!&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMIhj&ubah}(h]h ]h"]h$]h&]uh1jhj &ubeh}(h]h ]h"]h$]h&]uh1jhhhMIhjubj)}(h?pgrefill (npn) Amount of scanned pages (in an active LRU list) h](j)}(hpgrefill (npn)h]hpgrefill (npn)}(hj?&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMLhj;&ubj)}(hhh]h)}(h/Amount of scanned pages (in an active LRU list)h]h/Amount of scanned pages (in an active LRU list)}(hjP&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMLhjM&ubah}(h]h ]h"]h$]h&]uh1jhj;&ubeh}(h]h ]h"]h$]h&]uh1jhhhMLhjubj)}(h>pgactivate (npn) Amount of pages moved to the active LRU list h](j)}(hpgactivate (npn)h]hpgactivate (npn)}(hjn&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMOhjj&ubj)}(hhh]h)}(h,Amount of pages moved to the active LRU listh]h,Amount of pages moved to the active LRU list}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMOhj|&ubah}(h]h ]h"]h$]h&]uh1jhjj&ubeh}(h]h ]h"]h$]h&]uh1jhhhMOhjubj)}(hBpgdeactivate (npn) Amount of pages moved to the inactive LRU list h](j)}(hpgdeactivate (npn)h]hpgdeactivate (npn)}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMRhj&ubj)}(hhh]h)}(h.Amount of pages moved to the inactive LRU listh]h.Amount of pages moved to the inactive LRU list}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMRhj&ubah}(h]h ]h"]h$]h&]uh1jhj&ubeh}(h]h ]h"]h$]h&]uh1jhhhMRhjubj)}(hMpglazyfree (npn) Amount of pages postponed to be freed under memory pressure h](j)}(hpglazyfree (npn)h]hpglazyfree (npn)}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMUhj&ubj)}(hhh]h)}(h;Amount of pages postponed to be freed under memory pressureh]h;Amount of pages postponed to be freed under memory pressure}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMUhj&ubah}(h]h ]h"]h$]h&]uh1jhj&ubeh}(h]h ]h"]h$]h&]uh1jhhhMUhjubj)}(h5pglazyfreed (npn) Amount of reclaimed lazyfree pages h](j)}(hpglazyfreed (npn)h]hpglazyfreed (npn)}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMXhj&ubj)}(hhh]h)}(h"Amount of reclaimed lazyfree pagesh]h"Amount of reclaimed lazyfree pages}(hj 'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMXhj 'ubah}(h]h ]h"]h$]h&]uh1jhj&ubeh}(h]h ]h"]h$]h&]uh1jhhhMXhjubj)}(hswpin_zero Number of pages swapped into memory and filled with zero, where I/O was optimized out because the page content was detected to be zero during swapout. h](j)}(h swpin_zeroh]h swpin_zero}(hj*'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM]hj&'ubj)}(hhh]h)}(hNumber of pages swapped into memory and filled with zero, where I/O was optimized out because the page content was detected to be zero during swapout.h]hNumber of pages swapped into memory and filled with zero, where I/O was optimized out because the page content was detected to be zero during swapout.}(hj;'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM[hj8'ubah}(h]h ]h"]h$]h&]uh1jhj&'ubeh}(h]h ]h"]h$]h&]uh1jhhhM]hjubj)}(hpswpout_zero Number of zero-filled pages swapped out with I/O skipped due to the content being detected as zero. h](j)}(h swpout_zeroh]h swpout_zero}(hjY'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMahjU'ubj)}(hhh]h)}(hcNumber of zero-filled pages swapped out with I/O skipped due to the content being detected as zero.h]hcNumber of zero-filled pages swapped out with I/O skipped due to the content being detected as zero.}(hjj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM`hjg'ubah}(h]h ]h"]h$]h&]uh1jhjU'ubeh}(h]h ]h"]h$]h&]uh1jhhhMahjubj)}(h6zswpin Number of pages moved in to memory from zswap. h](j)}(hzswpinh]hzswpin}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMdhj'ubj)}(hhh]h)}(h.Number of pages moved in to memory from zswap.h]h.Number of pages moved in to memory from zswap.}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMdhj'ubah}(h]h ]h"]h$]h&]uh1jhj'ubeh}(h]h ]h"]h$]h&]uh1jhhhMdhjubj)}(h6zswpout Number of pages moved out of memory to zswap. h](j)}(hzswpouth]hzswpout}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMghj'ubj)}(hhh]h)}(h-Number of pages moved out of memory to zswap.h]h-Number of pages moved out of memory to zswap.}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMghj'ubah}(h]h ]h"]h$]h&]uh1jhj'ubeh}(h]h ]h"]h$]h&]uh1jhhhMghjubj)}(h3zswpwb Number of pages written from zswap to swap. h](j)}(hzswpwbh]hzswpwb}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMjhj'ubj)}(hhh]h)}(h+Number of pages written from zswap to swap.h]h+Number of pages written from zswap to swap.}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMjhj'ubah}(h]h ]h"]h$]h&]uh1jhj'ubeh}(h]h ]h"]h$]h&]uh1jhhhMjhjubj)}(hthp_fault_alloc (npn) Number of transparent hugepages which were allocated to satisfy a page fault. This counter is not present when CONFIG_TRANSPARENT_HUGEPAGE is not set. h](j)}(hthp_fault_alloc (npn)h]hthp_fault_alloc (npn)}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMohj(ubj)}(hhh]h)}(hNumber of transparent hugepages which were allocated to satisfy a page fault. This counter is not present when CONFIG_TRANSPARENT_HUGEPAGE is not set.h]hNumber of transparent hugepages which were allocated to satisfy a page fault. This counter is not present when CONFIG_TRANSPARENT_HUGEPAGE is not set.}(hj&(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMmhj#(ubah}(h]h ]h"]h$]h&]uh1jhj(ubeh}(h]h ]h"]h$]h&]uh1jhhhMohjubj)}(hthp_collapse_alloc (npn) Number of transparent hugepages which were allocated to allow collapsing an existing range of pages. This counter is not present when CONFIG_TRANSPARENT_HUGEPAGE is not set. h](j)}(hthp_collapse_alloc (npn)h]hthp_collapse_alloc (npn)}(hjD(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMthj@(ubj)}(hhh]h)}(hNumber of transparent hugepages which were allocated to allow collapsing an existing range of pages. This counter is not present when CONFIG_TRANSPARENT_HUGEPAGE is not set.h]hNumber of transparent hugepages which were allocated to allow collapsing an existing range of pages. This counter is not present when CONFIG_TRANSPARENT_HUGEPAGE is not set.}(hjU(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMrhjR(ubah}(h]h ]h"]h$]h&]uh1jhj@(ubeh}(h]h ]h"]h$]h&]uh1jhhhMthjubj)}(hcthp_swpout (npn) Number of transparent hugepages which are swapout in one piece without splitting. h](j)}(hthp_swpout (npn)h]hthp_swpout (npn)}(hjs(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMxhjo(ubj)}(hhh]h)}(hQNumber of transparent hugepages which are swapout in one piece without splitting.h]hQNumber of transparent hugepages which are swapout in one piece without splitting.}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMwhj(ubah}(h]h ]h"]h$]h&]uh1jhjo(ubeh}(h]h ]h"]h$]h&]uh1jhhhMxhjubj)}(hthp_swpout_fallback (npn) Number of transparent hugepages which were split before swapout. Usually because failed to allocate some continuous swap space for the huge page. h](j)}(hthp_swpout_fallback (npn)h]hthp_swpout_fallback (npn)}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM}hj(ubj)}(hhh]h)}(hNumber of transparent hugepages which were split before swapout. Usually because failed to allocate some continuous swap space for the huge page.h]hNumber of transparent hugepages which were split before swapout. Usually because failed to allocate some continuous swap space for the huge page.}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM{hj(ubah}(h]h ]h"]h$]h&]uh1jhj(ubeh}(h]h ]h"]h$]h&]uh1jhhhM}hjubj)}(hFnuma_pages_migrated (npn) Number of pages migrated by NUMA balancing. h](j)}(hnuma_pages_migrated (npn)h]hnuma_pages_migrated (npn)}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj(ubj)}(hhh]h)}(h+Number of pages migrated by NUMA balancing.h]h+Number of pages migrated by NUMA balancing.}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj(ubah}(h]h ]h"]h$]h&]uh1jhj(ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hnuma_pte_updates (npn) Number of pages whose page table entries are modified by NUMA balancing to produce NUMA hinting faults on access. h](j)}(hnuma_pte_updates (npn)h]hnuma_pte_updates (npn)}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj(ubj)}(hhh]h)}(hqNumber of pages whose page table entries are modified by NUMA balancing to produce NUMA hinting faults on access.h]hqNumber of pages whose page table entries are modified by NUMA balancing to produce NUMA hinting faults on access.}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj)ubah}(h]h ]h"]h$]h&]uh1jhj(ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(h6numa_hint_faults (npn) Number of NUMA hinting faults. h](j)}(hnuma_hint_faults (npn)h]hnuma_hint_faults (npn)}(hj/)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj+)ubj)}(hhh]h)}(hNumber of NUMA hinting faults.h]hNumber of NUMA hinting faults.}(hj@)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj=)ubah}(h]h ]h"]h$]h&]uh1jhj+)ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(h3pgdemote_kswapd Number of pages demoted by kswapd. h](j)}(hpgdemote_kswapdh]hpgdemote_kswapd}(hj^)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjZ)ubj)}(hhh]h)}(h"Number of pages demoted by kswapd.h]h"Number of pages demoted by kswapd.}(hjo)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjl)ubah}(h]h ]h"]h$]h&]uh1jhjZ)ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(h2pgdemote_direct Number of pages demoted directly. h](j)}(hpgdemote_directh]hpgdemote_direct}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj)ubj)}(hhh]h)}(h!Number of pages demoted directly.h]h!Number of pages demoted directly.}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj)ubah}(h]h ]h"]h$]h&]uh1jhj)ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(h;pgdemote_khugepaged Number of pages demoted by khugepaged. h](j)}(hpgdemote_khugepagedh]hpgdemote_khugepaged}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj)ubj)}(hhh]h)}(h&Number of pages demoted by khugepaged.h]h&Number of pages demoted by khugepaged.}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj)ubah}(h]h ]h"]h$]h&]uh1jhj)ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(h;pgdemote_proactive Number of pages demoted by proactively. h](j)}(hpgdemote_proactiveh]hpgdemote_proactive}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj)ubj)}(hhh]h)}(h'Number of pages demoted by proactively.h]h'Number of pages demoted by proactively.}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj)ubah}(h]h ]h"]h$]h&]uh1jhj)ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(hhugetlb Amount of memory used by hugetlb pages. This metric only shows up if hugetlb usage is accounted for in memory.current (i.e. cgroup is mounted with the memory_hugetlb_accounting option). h](j)}(hhugetlbh]hhugetlb}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj*ubj)}(hhh]h)}(hAmount of memory used by hugetlb pages. This metric only shows up if hugetlb usage is accounted for in memory.current (i.e. cgroup is mounted with the memory_hugetlb_accounting option).h]hAmount of memory used by hugetlb pages. This metric only shows up if hugetlb usage is accounted for in memory.current (i.e. cgroup is mounted with the memory_hugetlb_accounting option).}(hj+*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj(*ubah}(h]h ]h"]h$]h&]uh1jhj*ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjiubj)}(hXmemory.numa_stat A read-only nested-keyed file which exists on non-root cgroups. This breaks down the cgroup's memory footprint into different types of memory, type-specific details, and other information per node on the state of the memory management system. This is useful for providing visibility into the NUMA locality information within an memcg since the pages are allowed to be allocated from any physical node. One of the use case is evaluating application performance by combining this information with the application's CPU allocation. All memory amounts are in bytes. The output format of memory.numa_stat is:: type N0= N1= ... The entries are ordered to be human readable, and new entries can show up in the middle. Don't rely on items remaining in a fixed position; use the keys to look up specific values! The entries can refer to the memory.stat. h](j)}(hmemory.numa_stath]hmemory.numa_stat}(hja*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj]*ubj)}(hhh](h)}(h?A read-only nested-keyed file which exists on non-root cgroups.h]h?A read-only nested-keyed file which exists on non-root cgroups.}(hjr*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjo*ubh)}(hThis breaks down the cgroup's memory footprint into different types of memory, type-specific details, and other information per node on the state of the memory management system.h]hThis breaks down the cgroup’s memory footprint into different types of memory, type-specific details, and other information per node on the state of the memory management system.}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjo*ubh)}(hXThis is useful for providing visibility into the NUMA locality information within an memcg since the pages are allowed to be allocated from any physical node. One of the use case is evaluating application performance by combining this information with the application's CPU allocation.h]hXThis is useful for providing visibility into the NUMA locality information within an memcg since the pages are allowed to be allocated from any physical node. One of the use case is evaluating application performance by combining this information with the application’s CPU allocation.}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjo*ubh)}(h All memory amounts are in bytes.h]h All memory amounts are in bytes.}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjo*ubh)}(h*The output format of memory.numa_stat is::h]h)The output format of memory.numa_stat is:}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjo*ubjV)}(h2type N0= N1= ...h]h2type N0= N1= ...}hj*sbah}(h]h ]h"]h$]h&]jjuh1jUhhhMhjo*ubh)}(hThe entries are ordered to be human readable, and new entries can show up in the middle. Don't rely on items remaining in a fixed position; use the keys to look up specific values!h]hThe entries are ordered to be human readable, and new entries can show up in the middle. Don’t rely on items remaining in a fixed position; use the keys to look up specific values!}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjo*ubh)}(h)The entries can refer to the memory.stat.h]h)The entries can refer to the memory.stat.}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjo*ubeh}(h]h ]h"]h$]h&]uh1jhj]*ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjiubj)}(hmemory.swap.current A read-only single value file which exists on non-root cgroups. The total amount of swap currently being used by the cgroup and its descendants. h](j)}(hmemory.swap.currenth]hmemory.swap.current}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj*ubj)}(hhh](h)}(h?A read-only single value file which exists on non-root cgroups.h]h?A read-only single value file which exists on non-root cgroups.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubh)}(hPThe total amount of swap currently being used by the cgroup and its descendants.h]hPThe total amount of swap currently being used by the cgroup and its descendants.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubeh}(h]h ]h"]h$]h&]uh1jhj*ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjiubj)}(hXmemory.swap.high A read-write single value file which exists on non-root cgroups. The default is "max". Swap usage throttle limit. If a cgroup's swap usage exceeds this limit, all its further allocations will be throttled to allow userspace to implement custom out-of-memory procedures. This limit marks a point of no return for the cgroup. It is NOT designed to manage the amount of swapping a workload does during regular operation. Compare to memory.swap.max, which prohibits swapping past a set amount, but lets the cgroup continue unimpeded as long as other memory can be reclaimed. Healthy workloads are not expected to reach this limit. h](j)}(hmemory.swap.highh]hmemory.swap.high}(hj/+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj++ubj)}(hhh](h)}(hWA read-write single value file which exists on non-root cgroups. The default is "max".h]h[A read-write single value file which exists on non-root cgroups. The default is “max”.}(hj@+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj=+ubh)}(hSwap usage throttle limit. If a cgroup's swap usage exceeds this limit, all its further allocations will be throttled to allow userspace to implement custom out-of-memory procedures.h]hSwap usage throttle limit. If a cgroup’s swap usage exceeds this limit, all its further allocations will be throttled to allow userspace to implement custom out-of-memory procedures.}(hjN+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj=+ubh)}(hX,This limit marks a point of no return for the cgroup. It is NOT designed to manage the amount of swapping a workload does during regular operation. Compare to memory.swap.max, which prohibits swapping past a set amount, but lets the cgroup continue unimpeded as long as other memory can be reclaimed.h]hX,This limit marks a point of no return for the cgroup. It is NOT designed to manage the amount of swapping a workload does during regular operation. Compare to memory.swap.max, which prohibits swapping past a set amount, but lets the cgroup continue unimpeded as long as other memory can be reclaimed.}(hj\+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj=+ubh)}(h7Healthy workloads are not expected to reach this limit.h]h7Healthy workloads are not expected to reach this limit.}(hjj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj=+ubeh}(h]h ]h"]h$]h&]uh1jhj++ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjiubj)}(hXdmemory.swap.peak A read-write single value file which exists on non-root cgroups. The max swap usage recorded for the cgroup and its descendants since the creation of the cgroup or the most recent reset for that FD. A write of any non-empty string to this file resets it to the current memory usage for subsequent reads through the same file descriptor. h](j)}(hmemory.swap.peakh]hmemory.swap.peak}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj+ubj)}(hhh](h)}(h@A read-write single value file which exists on non-root cgroups.h]h@A read-write single value file which exists on non-root cgroups.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubh)}(hThe max swap usage recorded for the cgroup and its descendants since the creation of the cgroup or the most recent reset for that FD.h]hThe max swap usage recorded for the cgroup and its descendants since the creation of the cgroup or the most recent reset for that FD.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubh)}(hA write of any non-empty string to this file resets it to the current memory usage for subsequent reads through the same file descriptor.h]hA write of any non-empty string to this file resets it to the current memory usage for subsequent reads through the same file descriptor.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubeh}(h]h ]h"]h$]h&]uh1jhj+ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjiubj)}(hmemory.swap.max A read-write single value file which exists on non-root cgroups. The default is "max". Swap usage hard limit. If a cgroup's swap usage reaches this limit, anonymous memory of the cgroup will not be swapped out. h](j)}(hmemory.swap.maxh]hmemory.swap.max}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj+ubj)}(hhh](h)}(hWA read-write single value file which exists on non-root cgroups. The default is "max".h]h[A read-write single value file which exists on non-root cgroups. The default is “max”.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubh)}(h|Swap usage hard limit. If a cgroup's swap usage reaches this limit, anonymous memory of the cgroup will not be swapped out.h]h~Swap usage hard limit. If a cgroup’s swap usage reaches this limit, anonymous memory of the cgroup will not be swapped out.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubeh}(h]h ]h"]h$]h&]uh1jhj+ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjiubj)}(hX2memory.swap.events A read-only flat-keyed file which exists on non-root cgroups. The following entries are defined. Unless specified otherwise, a value change in this file generates a file modified event. high The number of times the cgroup's swap usage was over the high threshold. max The number of times the cgroup's swap usage was about to go over the max boundary and swap allocation failed. fail The number of times swap allocation failed either because of running out of swap system-wide or max limit. When reduced under the current usage, the existing swap entries are reclaimed gradually and the swap usage may stay higher than the limit for an extended period of time. This reduces the impact on the workload and memory management. h](j)}(hmemory.swap.eventsh]hmemory.swap.events}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj ,ubj)}(hhh](h)}(hA read-only flat-keyed file which exists on non-root cgroups. The following entries are defined. Unless specified otherwise, a value change in this file generates a file modified event.h]hA read-only flat-keyed file which exists on non-root cgroups. The following entries are defined. Unless specified otherwise, a value change in this file generates a file modified event.}(hj!,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj,ubj)}(hXbhigh The number of times the cgroup's swap usage was over the high threshold. max The number of times the cgroup's swap usage was about to go over the max boundary and swap allocation failed. fail The number of times swap allocation failed either because of running out of swap system-wide or max limit. h]j)}(hhh](j)}(hNhigh The number of times the cgroup's swap usage was over the high threshold. h](j)}(hhighh]hhigh}(hj:,hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj6,ubj)}(hhh]h)}(hHThe number of times the cgroup's swap usage was over the high threshold.h]hJThe number of times the cgroup’s swap usage was over the high threshold.}(hjK,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjH,ubah}(h]h ]h"]h$]h&]uh1jhj6,ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj3,ubj)}(hrmax The number of times the cgroup's swap usage was about to go over the max boundary and swap allocation failed. h](j)}(hmaxh]hmax}(hji,hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhje,ubj)}(hhh]h)}(hmThe number of times the cgroup's swap usage was about to go over the max boundary and swap allocation failed.h]hoThe number of times the cgroup’s swap usage was about to go over the max boundary and swap allocation failed.}(hjz,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjw,ubah}(h]h ]h"]h$]h&]uh1jhje,ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj3,ubj)}(hpfail The number of times swap allocation failed either because of running out of swap system-wide or max limit. h](j)}(hfailh]hfail}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj,ubj)}(hhh]h)}(hjThe number of times swap allocation failed either because of running out of swap system-wide or max limit.h]hjThe number of times swap allocation failed either because of running out of swap system-wide or max limit.}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj,ubah}(h]h ]h"]h$]h&]uh1jhj,ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj3,ubeh}(h]h ]h"]h$]h&]uh1jhj/,ubah}(h]h ]h"]h$]h&]uh1jhhhMhj,ubh)}(hWhen reduced under the current usage, the existing swap entries are reclaimed gradually and the swap usage may stay higher than the limit for an extended period of time. This reduces the impact on the workload and memory management.h]hWhen reduced under the current usage, the existing swap entries are reclaimed gradually and the swap usage may stay higher than the limit for an extended period of time. This reduces the impact on the workload and memory management.}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj,ubeh}(h]h ]h"]h$]h&]uh1jhj ,ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjiubj)}(hmemory.zswap.current A read-only single value file which exists on non-root cgroups. The total amount of memory consumed by the zswap compression backend. h](j)}(hmemory.zswap.currenth]hmemory.zswap.current}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj,ubj)}(hhh](h)}(h?A read-only single value file which exists on non-root cgroups.h]h?A read-only single value file which exists on non-root cgroups.}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj,ubh)}(hEThe total amount of memory consumed by the zswap compression backend.h]hEThe total amount of memory consumed by the zswap compression backend.}(hj -hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj,ubeh}(h]h ]h"]h$]h&]uh1jhj,ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjiubj)}(hXmemory.zswap.max A read-write single value file which exists on non-root cgroups. The default is "max". Zswap usage hard limit. If a cgroup's zswap pool reaches this limit, it will refuse to take any more stores before existing entries fault back in or are written out to disk. h](j)}(hmemory.zswap.maxh]hmemory.zswap.max}(hj*-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj&-ubj)}(hhh](h)}(hWA read-write single value file which exists on non-root cgroups. The default is "max".h]h[A read-write single value file which exists on non-root cgroups. The default is “max”.}(hj;-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj8-ubh)}(hZswap usage hard limit. If a cgroup's zswap pool reaches this limit, it will refuse to take any more stores before existing entries fault back in or are written out to disk.h]hZswap usage hard limit. If a cgroup’s zswap pool reaches this limit, it will refuse to take any more stores before existing entries fault back in or are written out to disk.}(hjI-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj8-ubeh}(h]h ]h"]h$]h&]uh1jhj&-ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjiubj)}(hX>memory.zswap.writeback A read-write single value file. The default value is "1". Note that this setting is hierarchical, i.e. the writeback would be implicitly disabled for child cgroups if the upper hierarchy does so. When this is set to 0, all swapping attempts to swapping devices are disabled. This included both zswap writebacks, and swapping due to zswap store failures. If the zswap store failures are recurring (for e.g if the pages are incompressible), users can observe reclaim inefficiency after disabling writeback (because the same pages might be rejected again and again). Note that this is subtly different from setting memory.swap.max to 0, as it still allows for pages to be written to the zswap pool. This setting has no effect if zswap is disabled, and swapping is allowed unless memory.swap.max is set to 0. h](j)}(hmemory.zswap.writebackh]hmemory.zswap.writeback}(hjg-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjc-ubj)}(hhh](h)}(hA read-write single value file. The default value is "1". Note that this setting is hierarchical, i.e. the writeback would be implicitly disabled for child cgroups if the upper hierarchy does so.h]hA read-write single value file. The default value is “1”. Note that this setting is hierarchical, i.e. the writeback would be implicitly disabled for child cgroups if the upper hierarchy does so.}(hjx-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhju-ubh)}(hXoWhen this is set to 0, all swapping attempts to swapping devices are disabled. This included both zswap writebacks, and swapping due to zswap store failures. If the zswap store failures are recurring (for e.g if the pages are incompressible), users can observe reclaim inefficiency after disabling writeback (because the same pages might be rejected again and again).h]hXoWhen this is set to 0, all swapping attempts to swapping devices are disabled. This included both zswap writebacks, and swapping due to zswap store failures. If the zswap store failures are recurring (for e.g if the pages are incompressible), users can observe reclaim inefficiency after disabling writeback (because the same pages might be rejected again and again).}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hju-ubh)}(hNote that this is subtly different from setting memory.swap.max to 0, as it still allows for pages to be written to the zswap pool. This setting has no effect if zswap is disabled, and swapping is allowed unless memory.swap.max is set to 0.h]hNote that this is subtly different from setting memory.swap.max to 0, as it still allows for pages to be written to the zswap pool. This setting has no effect if zswap is disabled, and swapping is allowed unless memory.swap.max is set to 0.}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhju-ubeh}(h]h ]h"]h$]h&]uh1jhjc-ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjiubj)}(hmemory.pressure A read-only nested-keyed file. Shows pressure stall information for memory. See :ref:`Documentation/accounting/psi.rst ` for details. h](j)}(hmemory.pressureh]hmemory.pressure}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj-ubj)}(hhh](h)}(hA read-only nested-keyed file.h]hA read-only nested-keyed file.}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj-ubh)}(hkShows pressure stall information for memory. See :ref:`Documentation/accounting/psi.rst ` for details.h](h1Shows pressure stall information for memory. See }(hj-hhhNhNubh)}(h-:ref:`Documentation/accounting/psi.rst `h]jX)}(hj-h]h Documentation/accounting/psi.rst}(hj-hhhNhNubah}(h]h ](jcstdstd-refeh"]h$]h&]uh1jWhj-ubah}(h]h ]h"]h$]h&]refdocjp refdomainj-reftyperef refexplicitrefwarnjvpsiuh1hhhhMhj-ubh for details.}(hj-hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj-ubeh}(h]h ]h"]h$]h&]uh1jhj-ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjiubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhM>hjzhhubeh}(h]memory-interface-filesah ]h"]memory interface filesah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hUsage Guidelinesh]hUsage Guidelines}(hj&.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#.hhhhhMubh)}(h"memory.high" is the main mechanism to control memory usage. Over-committing on high limit (sum of high limits > available memory) and letting global memory pressure to distribute memory according to usage is a viable strategy.h]h“memory.high” is the main mechanism to control memory usage. Over-committing on high limit (sum of high limits > available memory) and letting global memory pressure to distribute memory according to usage is a viable strategy.}(hj4.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj#.hhubh)}(hBecause breach of the high limit doesn't trigger the OOM killer but throttles the offending cgroup, a management agent has ample opportunities to monitor and take appropriate actions such as granting more memory or terminating the workload.h]hBecause breach of the high limit doesn’t trigger the OOM killer but throttles the offending cgroup, a management agent has ample opportunities to monitor and take appropriate actions such as granting more memory or terminating the workload.}(hjB.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM$hj#.hhubh)}(hX&Determining whether a cgroup has enough memory is not trivial as memory usage doesn't indicate whether the workload can benefit from more memory. For example, a workload which writes data received from network to a file can use all available memory but can also operate as performant with a small amount of memory. A measure of memory pressure - how much the workload is being impacted due to lack of memory - is necessary to determine whether a workload needs more memory; unfortunately, memory pressure monitoring mechanism isn't implemented yet.h]hX*Determining whether a cgroup has enough memory is not trivial as memory usage doesn’t indicate whether the workload can benefit from more memory. For example, a workload which writes data received from network to a file can use all available memory but can also operate as performant with a small amount of memory. A measure of memory pressure - how much the workload is being impacted due to lack of memory - is necessary to determine whether a workload needs more memory; unfortunately, memory pressure monitoring mechanism isn’t implemented yet.}(hjP.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM)hj#.hhubeh}(h]usage-guidelinesah ]h"]usage guidelinesah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hMemory Ownershiph]hMemory Ownership}(hji.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjf.hhhhhM5ubh)}(hXA memory area is charged to the cgroup which instantiated it and stays charged to the cgroup until the area is released. Migrating a process to a different cgroup doesn't move the memory usages that it instantiated while in the previous cgroup to the new cgroup.h]hX A memory area is charged to the cgroup which instantiated it and stays charged to the cgroup until the area is released. Migrating a process to a different cgroup doesn’t move the memory usages that it instantiated while in the previous cgroup to the new cgroup.}(hjw.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM7hjf.hhubh)}(hX A memory area may be used by processes belonging to different cgroups. To which cgroup the area will be charged is in-deterministic; however, over time, the memory area is likely to end up in a cgroup which has enough memory allowance to avoid high reclaim pressure.h]hX A memory area may be used by processes belonging to different cgroups. To which cgroup the area will be charged is in-deterministic; however, over time, the memory area is likely to end up in a cgroup which has enough memory allowance to avoid high reclaim pressure.}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM<hjf.hhubh)}(hX If a cgroup sweeps a considerable amount of memory which is expected to be accessed repeatedly by other cgroups, it may make sense to use POSIX_FADV_DONTNEED to relinquish the ownership of memory areas belonging to the affected files to ensure correct memory ownership.h]hX If a cgroup sweeps a considerable amount of memory which is expected to be accessed repeatedly by other cgroups, it may make sense to use POSIX_FADV_DONTNEED to relinquish the ownership of memory areas belonging to the affected files to ensure correct memory ownership.}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMAhjf.hhubeh}(h]memory-ownershipah ]h"]memory ownershipah$]h&]uh1hhjhhhhhM5ubeh}(h]memoryah ]h"]h$]memoryah&]uh1hhjhhhhhM referencedKubh)}(hhh](h)}(hIOh]hIO}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj.hhhhhMHubh)}(hX"The "io" controller regulates the distribution of IO resources. This controller implements both weight based and absolute bandwidth or IOPS limit distribution; however, weight based distribution is available only if cfq-iosched is in use and neither scheme is available for blk-mq devices.h]hX&The “io” controller regulates the distribution of IO resources. This controller implements both weight based and absolute bandwidth or IOPS limit distribution; however, weight based distribution is available only if cfq-iosched is in use and neither scheme is available for blk-mq devices.}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMJhj.hhubh)}(hhh](h)}(hIO Interface Filesh]hIO Interface Files}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj.hhhhhMRubj)}(hXio.stat A read-only nested-keyed file. Lines are keyed by $MAJ:$MIN device numbers and not ordered. The following nested keys are defined. ====== ===================== rbytes Bytes read wbytes Bytes written rios Number of read IOs wios Number of write IOs dbytes Bytes discarded dios Number of discard IOs ====== ===================== An example read output follows:: 8:16 rbytes=1459200 wbytes=314773504 rios=192 wios=353 dbytes=0 dios=0 8:0 rbytes=90430464 wbytes=299008000 rios=8950 wios=1252 dbytes=50331648 dios=3021 io.cost.qos A read-write nested-keyed file which exists only on the root cgroup. This file configures the Quality of Service of the IO cost model based controller (CONFIG_BLK_CGROUP_IOCOST) which currently implements "io.weight" proportional control. Lines are keyed by $MAJ:$MIN device numbers and not ordered. The line for a given device is populated on the first write for the device on "io.cost.qos" or "io.cost.model". The following nested keys are defined. ====== ===================================== enable Weight-based control enable ctrl "auto" or "user" rpct Read latency percentile [0, 100] rlat Read latency threshold wpct Write latency percentile [0, 100] wlat Write latency threshold min Minimum scaling percentage [1, 10000] max Maximum scaling percentage [1, 10000] ====== ===================================== The controller is disabled by default and can be enabled by setting "enable" to 1. "rpct" and "wpct" parameters default to zero and the controller uses internal device saturation state to adjust the overall IO rate between "min" and "max". When a better control quality is needed, latency QoS parameters can be configured. For example:: 8:16 enable=1 ctrl=auto rpct=95.00 rlat=75000 wpct=95.00 wlat=150000 min=50.00 max=150.0 shows that on sdb, the controller is enabled, will consider the device saturated if the 95th percentile of read completion latencies is above 75ms or write 150ms, and adjust the overall IO issue rate between 50% and 150% accordingly. The lower the saturation point, the better the latency QoS at the cost of aggregate bandwidth. The narrower the allowed adjustment range between "min" and "max", the more conformant to the cost model the IO behavior. Note that the IO issue base rate may be far off from 100% and setting "min" and "max" blindly can lead to a significant loss of device capacity or control quality. "min" and "max" are useful for regulating devices which show wide temporary behavior changes - e.g. a ssd which accepts writes at the line speed for a while and then completely stalls for multiple seconds. When "ctrl" is "auto", the parameters are controlled by the kernel and may change automatically. Setting "ctrl" to "user" or setting any of the percentile and latency parameters puts it into "user" mode and disables the automatic changes. The automatic mode can be restored by setting "ctrl" to "auto". io.cost.model A read-write nested-keyed file which exists only on the root cgroup. This file configures the cost model of the IO cost model based controller (CONFIG_BLK_CGROUP_IOCOST) which currently implements "io.weight" proportional control. Lines are keyed by $MAJ:$MIN device numbers and not ordered. The line for a given device is populated on the first write for the device on "io.cost.qos" or "io.cost.model". The following nested keys are defined. ===== ================================ ctrl "auto" or "user" model The cost model in use - "linear" ===== ================================ When "ctrl" is "auto", the kernel may change all parameters dynamically. When "ctrl" is set to "user" or any other parameters are written to, "ctrl" become "user" and the automatic changes are disabled. When "model" is "linear", the following model parameters are defined. ============= ======================================== [r|w]bps The maximum sequential IO throughput [r|w]seqiops The maximum 4k sequential IOs per second [r|w]randiops The maximum 4k random IOs per second ============= ======================================== From the above, the builtin linear model determines the base costs of a sequential and random IO and the cost coefficient for the IO size. While simple, this model can cover most common device classes acceptably. The IO cost model isn't expected to be accurate in absolute sense and is scaled to the device behavior dynamically. If needed, tools/cgroup/iocost_coef_gen.py can be used to generate device-specific coefficients. io.weight A read-write flat-keyed file which exists on non-root cgroups. The default is "default 100". The first line is the default weight applied to devices without specific override. The rest are overrides keyed by $MAJ:$MIN device numbers and not ordered. The weights are in the range [1, 10000] and specifies the relative amount IO time the cgroup can use in relation to its siblings. The default weight can be updated by writing either "default $WEIGHT" or simply "$WEIGHT". Overrides can be set by writing "$MAJ:$MIN $WEIGHT" and unset by writing "$MAJ:$MIN default". An example read output follows:: default 100 8:16 200 8:0 50 io.max A read-write nested-keyed file which exists on non-root cgroups. BPS and IOPS based IO limit. Lines are keyed by $MAJ:$MIN device numbers and not ordered. The following nested keys are defined. ===== ================================== rbps Max read bytes per second wbps Max write bytes per second riops Max read IO operations per second wiops Max write IO operations per second ===== ================================== When writing, any number of nested key-value pairs can be specified in any order. "max" can be specified as the value to remove a specific limit. If the same key is specified multiple times, the outcome is undefined. BPS and IOPS are measured in each IO direction and IOs are delayed if limit is reached. Temporary bursts are allowed. Setting read limit at 2M BPS and write at 120 IOPS for 8:16:: echo "8:16 rbps=2097152 wiops=120" > io.max Reading returns the following:: 8:16 rbps=2097152 wbps=max riops=max wiops=120 Write IOPS limit can be removed by writing the following:: echo "8:16 wiops=max" > io.max Reading now returns the following:: 8:16 rbps=2097152 wbps=max riops=max wiops=max io.pressure A read-only nested-keyed file. Shows pressure stall information for IO. See :ref:`Documentation/accounting/psi.rst ` for details. h]j)}(hhh](j)}(hX`io.stat A read-only nested-keyed file. Lines are keyed by $MAJ:$MIN device numbers and not ordered. The following nested keys are defined. ====== ===================== rbytes Bytes read wbytes Bytes written rios Number of read IOs wios Number of write IOs dbytes Bytes discarded dios Number of discard IOs ====== ===================== An example read output follows:: 8:16 rbytes=1459200 wbytes=314773504 rios=192 wios=353 dbytes=0 dios=0 8:0 rbytes=90430464 wbytes=299008000 rios=8950 wios=1252 dbytes=50331648 dios=3021 h](j)}(hio.stath]hio.stat}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMfhj.ubj)}(hhh](h)}(hA read-only nested-keyed file.h]hA read-only nested-keyed file.}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMUhj.ubh)}(hcLines are keyed by $MAJ:$MIN device numbers and not ordered. The following nested keys are defined.h]hcLines are keyed by $MAJ:$MIN device numbers and not ordered. The following nested keys are defined.}(hj /hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMWhj.ubj)}(hX====== ===================== rbytes Bytes read wbytes Bytes written rios Number of read IOs wios Number of write IOs dbytes Bytes discarded dios Number of discard IOs ====== ===================== h]j)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhj!/ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhj!/ubj)}(hhh](j)}(hhh](j)}(hhh]h)}(hrbytesh]hrbytes}(hjA/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM[hj>/ubah}(h]h ]h"]h$]h&]uh1jhj;/ubj)}(hhh]h)}(h Bytes readh]h Bytes read}(hjX/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM[hjU/ubah}(h]h ]h"]h$]h&]uh1jhj;/ubeh}(h]h ]h"]h$]h&]uh1jhj8/ubj)}(hhh](j)}(hhh]h)}(hwbytesh]hwbytes}(hjx/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM\hju/ubah}(h]h ]h"]h$]h&]uh1jhjr/ubj)}(hhh]h)}(h Bytes writtenh]h Bytes written}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM\hj/ubah}(h]h ]h"]h$]h&]uh1jhjr/ubeh}(h]h ]h"]h$]h&]uh1jhj8/ubj)}(hhh](j)}(hhh]h)}(hriosh]hrios}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM]hj/ubah}(h]h ]h"]h$]h&]uh1jhj/ubj)}(hhh]h)}(hNumber of read IOsh]hNumber of read IOs}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM]hj/ubah}(h]h ]h"]h$]h&]uh1jhj/ubeh}(h]h ]h"]h$]h&]uh1jhj8/ubj)}(hhh](j)}(hhh]h)}(hwiosh]hwios}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM^hj/ubah}(h]h ]h"]h$]h&]uh1jhj/ubj)}(hhh]h)}(hNumber of write IOsh]hNumber of write IOs}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM^hj/ubah}(h]h ]h"]h$]h&]uh1jhj/ubeh}(h]h ]h"]h$]h&]uh1jhj8/ubj)}(hhh](j)}(hhh]h)}(hdbytesh]hdbytes}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM_hj0ubah}(h]h ]h"]h$]h&]uh1jhj0ubj)}(hhh]h)}(hBytes discardedh]hBytes discarded}(hj40hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM_hj10ubah}(h]h ]h"]h$]h&]uh1jhj0ubeh}(h]h ]h"]h$]h&]uh1jhj8/ubj)}(hhh](j)}(hhh]h)}(hdiosh]hdios}(hjT0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM`hjQ0ubah}(h]h ]h"]h$]h&]uh1jhjN0ubj)}(hhh]h)}(hNumber of discard IOsh]hNumber of discard IOs}(hjk0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM`hjh0ubah}(h]h ]h"]h$]h&]uh1jhjN0ubeh}(h]h ]h"]h$]h&]uh1jhj8/ubeh}(h]h ]h"]h$]h&]uh1jhj!/ubeh}(h]h ]h"]h$]h&]colsKuh1jhj/ubah}(h]h ]h"]h$]h&]uh1jhj/ubah}(h]h ]h"]h$]h&]uh1jhhhMZhj.ubh)}(h An example read output follows::h]hAn example read output follows:}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMchj.ubjV)}(h8:16 rbytes=1459200 wbytes=314773504 rios=192 wios=353 dbytes=0 dios=0 8:0 rbytes=90430464 wbytes=299008000 rios=8950 wios=1252 dbytes=50331648 dios=3021h]h8:16 rbytes=1459200 wbytes=314773504 rios=192 wios=353 dbytes=0 dios=0 8:0 rbytes=90430464 wbytes=299008000 rios=8950 wios=1252 dbytes=50331648 dios=3021}hj0sbah}(h]h ]h"]h$]h&]jjuh1jUhhhMehj.ubeh}(h]h ]h"]h$]h&]uh1jhj.ubeh}(h]h ]h"]h$]h&]uh1jhhhMfhj.ubj)}(hX io.cost.qos A read-write nested-keyed file which exists only on the root cgroup. This file configures the Quality of Service of the IO cost model based controller (CONFIG_BLK_CGROUP_IOCOST) which currently implements "io.weight" proportional control. Lines are keyed by $MAJ:$MIN device numbers and not ordered. The line for a given device is populated on the first write for the device on "io.cost.qos" or "io.cost.model". The following nested keys are defined. ====== ===================================== enable Weight-based control enable ctrl "auto" or "user" rpct Read latency percentile [0, 100] rlat Read latency threshold wpct Write latency percentile [0, 100] wlat Write latency threshold min Minimum scaling percentage [1, 10000] max Maximum scaling percentage [1, 10000] ====== ===================================== The controller is disabled by default and can be enabled by setting "enable" to 1. "rpct" and "wpct" parameters default to zero and the controller uses internal device saturation state to adjust the overall IO rate between "min" and "max". When a better control quality is needed, latency QoS parameters can be configured. For example:: 8:16 enable=1 ctrl=auto rpct=95.00 rlat=75000 wpct=95.00 wlat=150000 min=50.00 max=150.0 shows that on sdb, the controller is enabled, will consider the device saturated if the 95th percentile of read completion latencies is above 75ms or write 150ms, and adjust the overall IO issue rate between 50% and 150% accordingly. The lower the saturation point, the better the latency QoS at the cost of aggregate bandwidth. The narrower the allowed adjustment range between "min" and "max", the more conformant to the cost model the IO behavior. Note that the IO issue base rate may be far off from 100% and setting "min" and "max" blindly can lead to a significant loss of device capacity or control quality. "min" and "max" are useful for regulating devices which show wide temporary behavior changes - e.g. a ssd which accepts writes at the line speed for a while and then completely stalls for multiple seconds. When "ctrl" is "auto", the parameters are controlled by the kernel and may change automatically. Setting "ctrl" to "user" or setting any of the percentile and latency parameters puts it into "user" mode and disables the automatic changes. The automatic mode can be restored by setting "ctrl" to "auto". h](j)}(h io.cost.qosh]h io.cost.qos}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj0ubj)}(hhh](h)}(hDA read-write nested-keyed file which exists only on the root cgroup.h]hDA read-write nested-keyed file which exists only on the root cgroup.}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMihj0ubh)}(hXThis file configures the Quality of Service of the IO cost model based controller (CONFIG_BLK_CGROUP_IOCOST) which currently implements "io.weight" proportional control. Lines are keyed by $MAJ:$MIN device numbers and not ordered. The line for a given device is populated on the first write for the device on "io.cost.qos" or "io.cost.model". The following nested keys are defined.h]hXThis file configures the Quality of Service of the IO cost model based controller (CONFIG_BLK_CGROUP_IOCOST) which currently implements “io.weight” proportional control. Lines are keyed by $MAJ:$MIN device numbers and not ordered. The line for a given device is populated on the first write for the device on “io.cost.qos” or “io.cost.model”. The following nested keys are defined.}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMlhj0ubj)}(hX====== ===================================== enable Weight-based control enable ctrl "auto" or "user" rpct Read latency percentile [0, 100] rlat Read latency threshold wpct Write latency percentile [0, 100] wlat Write latency threshold min Minimum scaling percentage [1, 10000] max Maximum scaling percentage [1, 10000] ====== ===================================== h]j)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhj0ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK%uh1jhj0ubj)}(hhh](j)}(hhh](j)}(hhh]h)}(henableh]henable}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMuhj1ubah}(h]h ]h"]h$]h&]uh1jhj1ubj)}(hhh]h)}(hWeight-based control enableh]hWeight-based control enable}(hj51hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMuhj21ubah}(h]h ]h"]h$]h&]uh1jhj1ubeh}(h]h ]h"]h$]h&]uh1jhj1ubj)}(hhh](j)}(hhh]h)}(hctrlh]hctrl}(hjU1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMvhjR1ubah}(h]h ]h"]h$]h&]uh1jhjO1ubj)}(hhh]h)}(h"auto" or "user"h]h“auto” or “user”}(hjl1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMvhji1ubah}(h]h ]h"]h$]h&]uh1jhjO1ubeh}(h]h ]h"]h$]h&]uh1jhj1ubj)}(hhh](j)}(hhh]h)}(hrpcth]hrpct}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMwhj1ubah}(h]h ]h"]h$]h&]uh1jhj1ubj)}(hhh]h)}(h#Read latency percentile [0, 100]h]h#Read latency percentile [0, 100]}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMwhj1ubah}(h]h ]h"]h$]h&]uh1jhj1ubeh}(h]h ]h"]h$]h&]uh1jhj1ubj)}(hhh](j)}(hhh]h)}(hrlath]hrlat}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMxhj1ubah}(h]h ]h"]h$]h&]uh1jhj1ubj)}(hhh]h)}(hRead latency thresholdh]hRead latency threshold}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMxhj1ubah}(h]h ]h"]h$]h&]uh1jhj1ubeh}(h]h ]h"]h$]h&]uh1jhj1ubj)}(hhh](j)}(hhh]h)}(hwpcth]hwpct}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMyhj1ubah}(h]h ]h"]h$]h&]uh1jhj1ubj)}(hhh]h)}(h#Write latency percentile [0, 100]h]h#Write latency percentile [0, 100]}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMyhj2ubah}(h]h ]h"]h$]h&]uh1jhj1ubeh}(h]h ]h"]h$]h&]uh1jhj1ubj)}(hhh](j)}(hhh]h)}(hwlath]hwlat}(hj12hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMzhj.2ubah}(h]h ]h"]h$]h&]uh1jhj+2ubj)}(hhh]h)}(hWrite latency thresholdh]hWrite latency threshold}(hjH2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMzhjE2ubah}(h]h ]h"]h$]h&]uh1jhj+2ubeh}(h]h ]h"]h$]h&]uh1jhj1ubj)}(hhh](j)}(hhh]h)}(hminh]hmin}(hjh2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM{hje2ubah}(h]h ]h"]h$]h&]uh1jhjb2ubj)}(hhh]h)}(h%Minimum scaling percentage [1, 10000]h]h%Minimum scaling percentage [1, 10000]}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM{hj|2ubah}(h]h ]h"]h$]h&]uh1jhjb2ubeh}(h]h ]h"]h$]h&]uh1jhj1ubj)}(hhh](j)}(hhh]h)}(hmaxh]hmax}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM|hj2ubah}(h]h ]h"]h$]h&]uh1jhj2ubj)}(hhh]h)}(h%Maximum scaling percentage [1, 10000]h]h%Maximum scaling percentage [1, 10000]}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM|hj2ubah}(h]h ]h"]h$]h&]uh1jhj2ubeh}(h]h ]h"]h$]h&]uh1jhj1ubeh}(h]h ]h"]h$]h&]uh1jhj0ubeh}(h]h ]h"]h$]h&]colsKuh1jhj0ubah}(h]h ]h"]h$]h&]uh1jhj0ubah}(h]h ]h"]h$]h&]uh1jhhhMthj0ubh)}(hThe controller is disabled by default and can be enabled by setting "enable" to 1. "rpct" and "wpct" parameters default to zero and the controller uses internal device saturation state to adjust the overall IO rate between "min" and "max".h]hXThe controller is disabled by default and can be enabled by setting “enable” to 1. “rpct” and “wpct” parameters default to zero and the controller uses internal device saturation state to adjust the overall IO rate between “min” and “max”.}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj0ubh)}(haWhen a better control quality is needed, latency QoS parameters can be configured. For example::h]h`When a better control quality is needed, latency QoS parameters can be configured. For example:}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj0ubjV)}(hX8:16 enable=1 ctrl=auto rpct=95.00 rlat=75000 wpct=95.00 wlat=150000 min=50.00 max=150.0h]hX8:16 enable=1 ctrl=auto rpct=95.00 rlat=75000 wpct=95.00 wlat=150000 min=50.00 max=150.0}hj3sbah}(h]h ]h"]h$]h&]jjuh1jUhhhMhj0ubh)}(hshows that on sdb, the controller is enabled, will consider the device saturated if the 95th percentile of read completion latencies is above 75ms or write 150ms, and adjust the overall IO issue rate between 50% and 150% accordingly.h]hshows that on sdb, the controller is enabled, will consider the device saturated if the 95th percentile of read completion latencies is above 75ms or write 150ms, and adjust the overall IO issue rate between 50% and 150% accordingly.}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj0ubh)}(hXMThe lower the saturation point, the better the latency QoS at the cost of aggregate bandwidth. The narrower the allowed adjustment range between "min" and "max", the more conformant to the cost model the IO behavior. Note that the IO issue base rate may be far off from 100% and setting "min" and "max" blindly can lead to a significant loss of device capacity or control quality. "min" and "max" are useful for regulating devices which show wide temporary behavior changes - e.g. a ssd which accepts writes at the line speed for a while and then completely stalls for multiple seconds.h]hXeThe lower the saturation point, the better the latency QoS at the cost of aggregate bandwidth. The narrower the allowed adjustment range between “min” and “max”, the more conformant to the cost model the IO behavior. Note that the IO issue base rate may be far off from 100% and setting “min” and “max” blindly can lead to a significant loss of device capacity or control quality. “min” and “max” are useful for regulating devices which show wide temporary behavior changes - e.g. a ssd which accepts writes at the line speed for a while and then completely stalls for multiple seconds.}(hj!3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj0ubh)}(hX0When "ctrl" is "auto", the parameters are controlled by the kernel and may change automatically. Setting "ctrl" to "user" or setting any of the percentile and latency parameters puts it into "user" mode and disables the automatic changes. The automatic mode can be restored by setting "ctrl" to "auto".h]hXLWhen “ctrl” is “auto”, the parameters are controlled by the kernel and may change automatically. Setting “ctrl” to “user” or setting any of the percentile and latency parameters puts it into “user” mode and disables the automatic changes. The automatic mode can be restored by setting “ctrl” to “auto”.}(hj/3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj0ubeh}(h]h ]h"]h$]h&]uh1jhj0ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj.ubj)}(hXZio.cost.model A read-write nested-keyed file which exists only on the root cgroup. This file configures the cost model of the IO cost model based controller (CONFIG_BLK_CGROUP_IOCOST) which currently implements "io.weight" proportional control. Lines are keyed by $MAJ:$MIN device numbers and not ordered. The line for a given device is populated on the first write for the device on "io.cost.qos" or "io.cost.model". The following nested keys are defined. ===== ================================ ctrl "auto" or "user" model The cost model in use - "linear" ===== ================================ When "ctrl" is "auto", the kernel may change all parameters dynamically. When "ctrl" is set to "user" or any other parameters are written to, "ctrl" become "user" and the automatic changes are disabled. When "model" is "linear", the following model parameters are defined. ============= ======================================== [r|w]bps The maximum sequential IO throughput [r|w]seqiops The maximum 4k sequential IOs per second [r|w]randiops The maximum 4k random IOs per second ============= ======================================== From the above, the builtin linear model determines the base costs of a sequential and random IO and the cost coefficient for the IO size. While simple, this model can cover most common device classes acceptably. The IO cost model isn't expected to be accurate in absolute sense and is scaled to the device behavior dynamically. If needed, tools/cgroup/iocost_coef_gen.py can be used to generate device-specific coefficients. h](j)}(h io.cost.modelh]h io.cost.model}(hjM3hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjI3ubj)}(hhh](h)}(hDA read-write nested-keyed file which exists only on the root cgroup.h]hDA read-write nested-keyed file which exists only on the root cgroup.}(hj^3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj[3ubh)}(hXxThis file configures the cost model of the IO cost model based controller (CONFIG_BLK_CGROUP_IOCOST) which currently implements "io.weight" proportional control. Lines are keyed by $MAJ:$MIN device numbers and not ordered. The line for a given device is populated on the first write for the device on "io.cost.qos" or "io.cost.model". The following nested keys are defined.h]hXThis file configures the cost model of the IO cost model based controller (CONFIG_BLK_CGROUP_IOCOST) which currently implements “io.weight” proportional control. Lines are keyed by $MAJ:$MIN device numbers and not ordered. The line for a given device is populated on the first write for the device on “io.cost.qos” or “io.cost.model”. The following nested keys are defined.}(hjl3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj[3ubj)}(h===== ================================ ctrl "auto" or "user" model The cost model in use - "linear" ===== ================================ h]j)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhj3ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jhj3ubj)}(hhh](j)}(hhh](j)}(hhh]h)}(hctrlh]hctrl}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj3ubah}(h]h ]h"]h$]h&]uh1jhj3ubj)}(hhh]h)}(h"auto" or "user"h]h“auto” or “user”}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj3ubah}(h]h ]h"]h$]h&]uh1jhj3ubeh}(h]h ]h"]h$]h&]uh1jhj3ubj)}(hhh](j)}(hhh]h)}(hmodelh]hmodel}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj3ubah}(h]h ]h"]h$]h&]uh1jhj3ubj)}(hhh]h)}(h The cost model in use - "linear"h]h$The cost model in use - “linear”}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj3ubah}(h]h ]h"]h$]h&]uh1jhj3ubeh}(h]h ]h"]h$]h&]uh1jhj3ubeh}(h]h ]h"]h$]h&]uh1jhj3ubeh}(h]h ]h"]h$]h&]colsKuh1jhj~3ubah}(h]h ]h"]h$]h&]uh1jhjz3ubah}(h]h ]h"]h$]h&]uh1jhhhMhj[3ubh)}(hWhen "ctrl" is "auto", the kernel may change all parameters dynamically. When "ctrl" is set to "user" or any other parameters are written to, "ctrl" become "user" and the automatic changes are disabled.h]hWhen “ctrl” is “auto”, the kernel may change all parameters dynamically. When “ctrl” is set to “user” or any other parameters are written to, “ctrl” become “user” and the automatic changes are disabled.}(hj"4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj[3ubh)}(hEWhen "model" is "linear", the following model parameters are defined.h]hMWhen “model” is “linear”, the following model parameters are defined.}(hj04hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj[3ubj)}(hX ============= ======================================== [r|w]bps The maximum sequential IO throughput [r|w]seqiops The maximum 4k sequential IOs per second [r|w]randiops The maximum 4k random IOs per second ============= ======================================== h]j)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jhjE4ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK(uh1jhjE4ubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h[r|w]bpsh]h[r|w]bps}(hje4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjb4ubah}(h]h ]h"]h$]h&]uh1jhj_4ubj)}(hhh]h)}(h$The maximum sequential IO throughputh]h$The maximum sequential IO throughput}(hj|4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjy4ubah}(h]h ]h"]h$]h&]uh1jhj_4ubeh}(h]h ]h"]h$]h&]uh1jhj\4ubj)}(hhh](j)}(hhh]h)}(h [r|w]seqiopsh]h [r|w]seqiops}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj4ubah}(h]h ]h"]h$]h&]uh1jhj4ubj)}(hhh]h)}(h(The maximum 4k sequential IOs per secondh]h(The maximum 4k sequential IOs per second}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj4ubah}(h]h ]h"]h$]h&]uh1jhj4ubeh}(h]h ]h"]h$]h&]uh1jhj\4ubj)}(hhh](j)}(hhh]h)}(h [r|w]randiopsh]h [r|w]randiops}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj4ubah}(h]h ]h"]h$]h&]uh1jhj4ubj)}(hhh]h)}(h$The maximum 4k random IOs per secondh]h$The maximum 4k random IOs per second}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj4ubah}(h]h ]h"]h$]h&]uh1jhj4ubeh}(h]h ]h"]h$]h&]uh1jhj\4ubeh}(h]h ]h"]h$]h&]uh1jhjE4ubeh}(h]h ]h"]h$]h&]colsKuh1jhjB4ubah}(h]h ]h"]h$]h&]uh1jhj>4ubah}(h]h ]h"]h$]h&]uh1jhhhMhj[3ubh)}(hFrom the above, the builtin linear model determines the base costs of a sequential and random IO and the cost coefficient for the IO size. While simple, this model can cover most common device classes acceptably.h]hFrom the above, the builtin linear model determines the base costs of a sequential and random IO and the cost coefficient for the IO size. While simple, this model can cover most common device classes acceptably.}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj[3ubh)}(hsThe IO cost model isn't expected to be accurate in absolute sense and is scaled to the device behavior dynamically.h]huThe IO cost model isn’t expected to be accurate in absolute sense and is scaled to the device behavior dynamically.}(hj+5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj[3ubh)}(h`If needed, tools/cgroup/iocost_coef_gen.py can be used to generate device-specific coefficients.h]h`If needed, tools/cgroup/iocost_coef_gen.py can be used to generate device-specific coefficients.}(hj95hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj[3ubeh}(h]h ]h"]h$]h&]uh1jhjI3ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj.ubj)}(hXio.weight A read-write flat-keyed file which exists on non-root cgroups. The default is "default 100". The first line is the default weight applied to devices without specific override. The rest are overrides keyed by $MAJ:$MIN device numbers and not ordered. The weights are in the range [1, 10000] and specifies the relative amount IO time the cgroup can use in relation to its siblings. The default weight can be updated by writing either "default $WEIGHT" or simply "$WEIGHT". Overrides can be set by writing "$MAJ:$MIN $WEIGHT" and unset by writing "$MAJ:$MIN default". An example read output follows:: default 100 8:16 200 8:0 50 h](j)}(h io.weighth]h io.weight}(hjW5hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjS5ubj)}(hhh](h)}(h\A read-write flat-keyed file which exists on non-root cgroups. The default is "default 100".h]h`A read-write flat-keyed file which exists on non-root cgroups. The default is “default 100”.}(hjh5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhje5ubh)}(hX The first line is the default weight applied to devices without specific override. The rest are overrides keyed by $MAJ:$MIN device numbers and not ordered. The weights are in the range [1, 10000] and specifies the relative amount IO time the cgroup can use in relation to its siblings.h]hX The first line is the default weight applied to devices without specific override. The rest are overrides keyed by $MAJ:$MIN device numbers and not ordered. The weights are in the range [1, 10000] and specifies the relative amount IO time the cgroup can use in relation to its siblings.}(hjv5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhje5ubh)}(hThe default weight can be updated by writing either "default $WEIGHT" or simply "$WEIGHT". Overrides can be set by writing "$MAJ:$MIN $WEIGHT" and unset by writing "$MAJ:$MIN default".h]hThe default weight can be updated by writing either “default $WEIGHT” or simply “$WEIGHT”. Overrides can be set by writing “$MAJ:$MIN $WEIGHT” and unset by writing “$MAJ:$MIN default”.}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhje5ubh)}(h An example read output follows::h]hAn example read output follows:}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhje5ubjV)}(hdefault 100 8:16 200 8:0 50h]hdefault 100 8:16 200 8:0 50}hj5sbah}(h]h ]h"]h$]h&]jjuh1jUhhhMhje5ubeh}(h]h ]h"]h$]h&]uh1jhjS5ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj.ubj)}(hXio.max A read-write nested-keyed file which exists on non-root cgroups. BPS and IOPS based IO limit. Lines are keyed by $MAJ:$MIN device numbers and not ordered. The following nested keys are defined. ===== ================================== rbps Max read bytes per second wbps Max write bytes per second riops Max read IO operations per second wiops Max write IO operations per second ===== ================================== When writing, any number of nested key-value pairs can be specified in any order. "max" can be specified as the value to remove a specific limit. If the same key is specified multiple times, the outcome is undefined. BPS and IOPS are measured in each IO direction and IOs are delayed if limit is reached. Temporary bursts are allowed. Setting read limit at 2M BPS and write at 120 IOPS for 8:16:: echo "8:16 rbps=2097152 wiops=120" > io.max Reading returns the following:: 8:16 rbps=2097152 wbps=max riops=max wiops=120 Write IOPS limit can be removed by writing the following:: echo "8:16 wiops=max" > io.max Reading now returns the following:: 8:16 rbps=2097152 wbps=max riops=max wiops=max h](j)}(hio.maxh]hio.max}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj5ubj)}(hhh](h)}(h@A read-write nested-keyed file which exists on non-root cgroups.h]h@A read-write nested-keyed file which exists on non-root cgroups.}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj5ubh)}(hBPS and IOPS based IO limit. Lines are keyed by $MAJ:$MIN device numbers and not ordered. The following nested keys are defined.h]hBPS and IOPS based IO limit. Lines are keyed by $MAJ:$MIN device numbers and not ordered. The following nested keys are defined.}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj5ubj)}(hX===== ================================== rbps Max read bytes per second wbps Max write bytes per second riops Max read IO operations per second wiops Max write IO operations per second ===== ================================== h]j)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhj5ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK"uh1jhj5ubj)}(hhh](j)}(hhh](j)}(hhh]h)}(hrbpsh]hrbps}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj6ubah}(h]h ]h"]h$]h&]uh1jhj 6ubj)}(hhh]h)}(hMax read bytes per secondh]hMax read bytes per second}(hj)6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj&6ubah}(h]h ]h"]h$]h&]uh1jhj 6ubeh}(h]h ]h"]h$]h&]uh1jhj 6ubj)}(hhh](j)}(hhh]h)}(hwbpsh]hwbps}(hjI6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjF6ubah}(h]h ]h"]h$]h&]uh1jhjC6ubj)}(hhh]h)}(hMax write bytes per secondh]hMax write bytes per second}(hj`6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj]6ubah}(h]h ]h"]h$]h&]uh1jhjC6ubeh}(h]h ]h"]h$]h&]uh1jhj 6ubj)}(hhh](j)}(hhh]h)}(hriopsh]hriops}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj}6ubah}(h]h ]h"]h$]h&]uh1jhjz6ubj)}(hhh]h)}(h!Max read IO operations per secondh]h!Max read IO operations per second}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj6ubah}(h]h ]h"]h$]h&]uh1jhjz6ubeh}(h]h ]h"]h$]h&]uh1jhj 6ubj)}(hhh](j)}(hhh]h)}(hwiopsh]hwiops}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj6ubah}(h]h ]h"]h$]h&]uh1jhj6ubj)}(hhh]h)}(h"Max write IO operations per secondh]h"Max write IO operations per second}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj6ubah}(h]h ]h"]h$]h&]uh1jhj6ubeh}(h]h ]h"]h$]h&]uh1jhj 6ubeh}(h]h ]h"]h$]h&]uh1jhj5ubeh}(h]h ]h"]h$]h&]colsKuh1jhj5ubah}(h]h ]h"]h$]h&]uh1jhj5ubah}(h]h ]h"]h$]h&]uh1jhhhMhj5ubh)}(hWhen writing, any number of nested key-value pairs can be specified in any order. "max" can be specified as the value to remove a specific limit. If the same key is specified multiple times, the outcome is undefined.h]hWhen writing, any number of nested key-value pairs can be specified in any order. “max” can be specified as the value to remove a specific limit. If the same key is specified multiple times, the outcome is undefined.}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj5ubh)}(hvBPS and IOPS are measured in each IO direction and IOs are delayed if limit is reached. Temporary bursts are allowed.h]hvBPS and IOPS are measured in each IO direction and IOs are delayed if limit is reached. Temporary bursts are allowed.}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj5ubh)}(h=Setting read limit at 2M BPS and write at 120 IOPS for 8:16::h]h io.maxh]h+echo "8:16 rbps=2097152 wiops=120" > io.max}hj+7sbah}(h]h ]h"]h$]h&]jjuh1jUhhhMhj5ubh)}(hReading returns the following::h]hReading returns the following:}(hj97hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj5ubjV)}(h.8:16 rbps=2097152 wbps=max riops=max wiops=120h]h.8:16 rbps=2097152 wbps=max riops=max wiops=120}hjG7sbah}(h]h ]h"]h$]h&]jjuh1jUhhhMhj5ubh)}(h:Write IOPS limit can be removed by writing the following::h]h9Write IOPS limit can be removed by writing the following:}(hjU7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj5ubjV)}(hecho "8:16 wiops=max" > io.maxh]hecho "8:16 wiops=max" > io.max}hjc7sbah}(h]h ]h"]h$]h&]jjuh1jUhhhMhj5ubh)}(h#Reading now returns the following::h]h"Reading now returns the following:}(hjq7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj5ubjV)}(h.8:16 rbps=2097152 wbps=max riops=max wiops=maxh]h.8:16 rbps=2097152 wbps=max riops=max wiops=max}hj7sbah}(h]h ]h"]h$]h&]jjuh1jUhhhMhj5ubeh}(h]h ]h"]h$]h&]uh1jhj5ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj.ubj)}(hio.pressure A read-only nested-keyed file. Shows pressure stall information for IO. See :ref:`Documentation/accounting/psi.rst ` for details. h](j)}(h io.pressureh]h io.pressure}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hj7ubj)}(hhh](h)}(hA read-only nested-keyed file.h]hA read-only nested-keyed file.}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj7ubh)}(hgShows pressure stall information for IO. See :ref:`Documentation/accounting/psi.rst ` for details.h](h-Shows pressure stall information for IO. See }(hj7hhhNhNubh)}(h-:ref:`Documentation/accounting/psi.rst `h]jX)}(hj7h]h Documentation/accounting/psi.rst}(hj7hhhNhNubah}(h]h ](jcstdstd-refeh"]h$]h&]uh1jWhj7ubah}(h]h ]h"]h$]h&]refdocjp refdomainj7reftyperef refexplicitrefwarnjvpsiuh1hhhhMhj7ubh for details.}(hj7hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj7ubeh}(h]h ]h"]h$]h&]uh1jhj7ubeh}(h]h ]h"]h$]h&]uh1jhhhM hj.ubeh}(h]h ]h"]h$]h&]uh1jhj.ubah}(h]h ]h"]h$]h&]uh1jhhhMThj.hhubeh}(h]io-interface-filesah ]h"]io interface filesah$]h&]uh1hhj.hhhhhMRubh)}(hhh](h)}(h Writebackh]h Writeback}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8hhhhhM ubh)}(hXPage cache is dirtied through buffered writes and shared mmaps and written asynchronously to the backing filesystem by the writeback mechanism. Writeback sits between the memory and IO domains and regulates the proportion of dirty memory by balancing dirtying and write IOs.h]hXPage cache is dirtied through buffered writes and shared mmaps and written asynchronously to the backing filesystem by the writeback mechanism. Writeback sits between the memory and IO domains and regulates the proportion of dirty memory by balancing dirtying and write IOs.}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj8hhubh)}(hXThe io controller, in conjunction with the memory controller, implements control of page cache writeback IOs. The memory controller defines the memory domain that dirty memory ratio is calculated and maintained for and the io controller defines the io domain which writes out dirty pages for the memory domain. Both system-wide and per-cgroup dirty memory states are examined and the more restrictive of the two is enforced.h]hXThe io controller, in conjunction with the memory controller, implements control of page cache writeback IOs. The memory controller defines the memory domain that dirty memory ratio is calculated and maintained for and the io controller defines the io domain which writes out dirty pages for the memory domain. Both system-wide and per-cgroup dirty memory states are examined and the more restrictive of the two is enforced.}(hj-8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj8hhubh)}(hcgroup writeback requires explicit support from the underlying filesystem. Currently, cgroup writeback is implemented on ext2, ext4, btrfs, f2fs, and xfs. On other filesystems, all writeback IOs are attributed to the root cgroup.h]hcgroup writeback requires explicit support from the underlying filesystem. Currently, cgroup writeback is implemented on ext2, ext4, btrfs, f2fs, and xfs. On other filesystems, all writeback IOs are attributed to the root cgroup.}(hj;8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj8hhubh)}(hX>There are inherent differences in memory and writeback management which affects how cgroup ownership is tracked. Memory is tracked per page while writeback per inode. For the purpose of writeback, an inode is assigned to a cgroup and all IO requests to write dirty pages from the inode are attributed to that cgroup.h]hX>There are inherent differences in memory and writeback management which affects how cgroup ownership is tracked. Memory is tracked per page while writeback per inode. For the purpose of writeback, an inode is assigned to a cgroup and all IO requests to write dirty pages from the inode are attributed to that cgroup.}(hjI8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM!hj8hhubh)}(hXAs cgroup ownership for memory is tracked per page, there can be pages which are associated with different cgroups than the one the inode is associated with. These are called foreign pages. The writeback constantly keeps track of foreign pages and, if a particular foreign cgroup becomes the majority over a certain period of time, switches the ownership of the inode to that cgroup.h]hXAs cgroup ownership for memory is tracked per page, there can be pages which are associated with different cgroups than the one the inode is associated with. These are called foreign pages. The writeback constantly keeps track of foreign pages and, if a particular foreign cgroup becomes the majority over a certain period of time, switches the ownership of the inode to that cgroup.}(hjW8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM'hj8hhubh)}(hXrWhile this model is enough for most use cases where a given inode is mostly dirtied by a single cgroup even when the main writing cgroup changes over time, use cases where multiple cgroups write to a single inode simultaneously are not supported well. In such circumstances, a significant portion of IOs are likely to be attributed incorrectly. As memory controller assigns page ownership on the first use and doesn't update it until the page is released, even if writeback strictly follows page ownership, multiple cgroups dirtying overlapping areas wouldn't work as expected. It's recommended to avoid such usage patterns.h]hXxWhile this model is enough for most use cases where a given inode is mostly dirtied by a single cgroup even when the main writing cgroup changes over time, use cases where multiple cgroups write to a single inode simultaneously are not supported well. In such circumstances, a significant portion of IOs are likely to be attributed incorrectly. As memory controller assigns page ownership on the first use and doesn’t update it until the page is released, even if writeback strictly follows page ownership, multiple cgroups dirtying overlapping areas wouldn’t work as expected. It’s recommended to avoid such usage patterns.}(hje8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM.hj8hhubh)}(h\The sysctl knobs which affect writeback behavior are applied to cgroup writeback as follows.h]h\The sysctl knobs which affect writeback behavior are applied to cgroup writeback as follows.}(hjs8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM9hj8hhubj)}(hXvm.dirty_background_ratio, vm.dirty_ratio These ratios apply the same to cgroup writeback with the amount of available memory capped by limits imposed by the memory controller and system-wide clean memory. vm.dirty_background_bytes, vm.dirty_bytes For cgroup writeback, this is calculated into ratio against total available memory and applied the same way as vm.dirty[_background]_ratio. h]j)}(hhh](j)}(hvm.dirty_background_ratio, vm.dirty_ratio These ratios apply the same to cgroup writeback with the amount of available memory capped by limits imposed by the memory controller and system-wide clean memory. h](j)}(h)vm.dirty_background_ratio, vm.dirty_ratioh]h)vm.dirty_background_ratio, vm.dirty_ratio}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM?hj8ubj)}(hhh]h)}(hThese ratios apply the same to cgroup writeback with the amount of available memory capped by limits imposed by the memory controller and system-wide clean memory.h]hThese ratios apply the same to cgroup writeback with the amount of available memory capped by limits imposed by the memory controller and system-wide clean memory.}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM=hj8ubah}(h]h ]h"]h$]h&]uh1jhj8ubeh}(h]h ]h"]h$]h&]uh1jhhhM?hj8ubj)}(hvm.dirty_background_bytes, vm.dirty_bytes For cgroup writeback, this is calculated into ratio against total available memory and applied the same way as vm.dirty[_background]_ratio. h](j)}(h)vm.dirty_background_bytes, vm.dirty_bytesh]h)vm.dirty_background_bytes, vm.dirty_bytes}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMEhj8ubj)}(hhh]h)}(hFor cgroup writeback, this is calculated into ratio against total available memory and applied the same way as vm.dirty[_background]_ratio.h]hFor cgroup writeback, this is calculated into ratio against total available memory and applied the same way as vm.dirty[_background]_ratio.}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMBhj8ubah}(h]h ]h"]h$]h&]uh1jhj8ubeh}(h]h ]h"]h$]h&]uh1jhhhMEhj8ubeh}(h]h ]h"]h$]h&]uh1jhj8ubah}(h]h ]h"]h$]h&]uh1jhhhM<hj8hhubeh}(h] writebackah ]h"] writebackah$]h&]uh1hhj.hhhhhM ubh)}(hhh](h)}(h IO Latencyh]h IO Latency}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8hhhhhMHubh)}(hThis is a cgroup v2 controller for IO workload protection. You provide a group with a latency target, and if the average latency exceeds that target the controller will throttle any peers that have a lower latency target than the protected workload.h]hThis is a cgroup v2 controller for IO workload protection. You provide a group with a latency target, and if the average latency exceeds that target the controller will throttle any peers that have a lower latency target than the protected workload.}(hj 9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMJhj8hhubh)}(hThe limits are only applied at the peer level in the hierarchy. This means that in the diagram below, only groups A, B, and C will influence each other, and groups D and F will influence each other. Group G will influence nobody::h]hThe limits are only applied at the peer level in the hierarchy. This means that in the diagram below, only groups A, B, and C will influence each other, and groups D and F will influence each other. Group G will influence nobody:}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMOhj8hhubjV)}(hf [root] / | \ A B C / \ | D F Gh]hf [root] / | \ A B C / \ | D F G}hj'9sbah}(h]h ]h"]h$]h&]jjuh1jUhhhMShj8hhubh)}(hX So the ideal way to configure this is to set io.latency in groups A, B, and C. Generally you do not want to set a value lower than the latency your device supports. Experiment to find the value that works best for your workload. Start at higher than the expected latency for your device and watch the avg_lat value in io.stat for your workload group to get an idea of the latency you see during normal operation. Use the avg_lat value as a basis for your real setting, setting at 10-15% higher than the value in io.stat.h]hX So the ideal way to configure this is to set io.latency in groups A, B, and C. Generally you do not want to set a value lower than the latency your device supports. Experiment to find the value that works best for your workload. Start at higher than the expected latency for your device and watch the avg_lat value in io.stat for your workload group to get an idea of the latency you see during normal operation. Use the avg_lat value as a basis for your real setting, setting at 10-15% higher than the value in io.stat.}(hj59hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMZhj8hhubeh}(h] io-latencyah ]h"] io latencyah$]h&]uh1hhj.hhhhhMHubh)}(hhh](h)}(hHow IO Latency Throttling Worksh]hHow IO Latency Throttling Works}(hjN9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjK9hhhhhMcubh)}(hX io.latency is work conserving; so as long as everybody is meeting their latency target the controller doesn't do anything. Once a group starts missing its target it begins throttling any peer group that has a higher target than itself. This throttling takes 2 forms:h]hX io.latency is work conserving; so as long as everybody is meeting their latency target the controller doesn’t do anything. Once a group starts missing its target it begins throttling any peer group that has a higher target than itself. This throttling takes 2 forms:}(hj\9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMehjK9hhubj)}(hhh](j)}(hQueue depth throttling. This is the number of outstanding IO's a group is allowed to have. We will clamp down relatively quickly, starting at no limit and going all the way down to 1 IO at a time. h]h)}(hQueue depth throttling. This is the number of outstanding IO's a group is allowed to have. We will clamp down relatively quickly, starting at no limit and going all the way down to 1 IO at a time.h]hQueue depth throttling. This is the number of outstanding IO’s a group is allowed to have. We will clamp down relatively quickly, starting at no limit and going all the way down to 1 IO at a time.}(hjq9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMjhjm9ubah}(h]h ]h"]h$]h&]uh1jhjj9hhhhhNubj)}(hXArtificial delay induction. There are certain types of IO that cannot be throttled without possibly adversely affecting higher priority groups. This includes swapping and metadata IO. These types of IO are allowed to occur normally, however they are "charged" to the originating group. If the originating group is being throttled you will see the use_delay and delay fields in io.stat increase. The delay value is how many microseconds that are being added to any process that runs in this group. Because this number can grow quite large if there is a lot of swapping or metadata IO occurring we limit the individual delay events to 1 second at a time. h]h)}(hXArtificial delay induction. There are certain types of IO that cannot be throttled without possibly adversely affecting higher priority groups. This includes swapping and metadata IO. These types of IO are allowed to occur normally, however they are "charged" to the originating group. If the originating group is being throttled you will see the use_delay and delay fields in io.stat increase. The delay value is how many microseconds that are being added to any process that runs in this group. Because this number can grow quite large if there is a lot of swapping or metadata IO occurring we limit the individual delay events to 1 second at a time.h]hXArtificial delay induction. There are certain types of IO that cannot be throttled without possibly adversely affecting higher priority groups. This includes swapping and metadata IO. These types of IO are allowed to occur normally, however they are “charged” to the originating group. If the originating group is being throttled you will see the use_delay and delay fields in io.stat increase. The delay value is how many microseconds that are being added to any process that runs in this group. Because this number can grow quite large if there is a lot of swapping or metadata IO occurring we limit the individual delay events to 1 second at a time.}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMnhj9ubah}(h]h ]h"]h$]h&]uh1jhjj9hhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhMjhjK9hhubh)}(hOnce the victimized group starts meeting its latency target again it will start unthrottling any peer groups that were throttled previously. If the victimized group simply stops doing IO the global counter will unthrottle appropriately.h]hOnce the victimized group starts meeting its latency target again it will start unthrottling any peer groups that were throttled previously. If the victimized group simply stops doing IO the global counter will unthrottle appropriately.}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMxhjK9hhubeh}(h]how-io-latency-throttling-worksah ]h"]how io latency throttling worksah$]h&]uh1hhj.hhhhhMcubh)}(hhh](h)}(hIO Latency Interface Filesh]hIO Latency Interface Files}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj9hhhhhM}ubj)}(hX}io.latency This takes a similar format as the other controllers. "MAJOR:MINOR target=" io.stat If the controller is enabled you will see extra stats in io.stat in addition to the normal ones. depth This is the current queue depth for the group. avg_lat This is an exponential moving average with a decay rate of 1/exp bound by the sampling interval. The decay rate interval can be calculated by multiplying the win value in io.stat by the corresponding number of samples based on the win value. win The sampling window size in milliseconds. This is the minimum duration of time between evaluation events. Windows only elapse with IO activity. Idle periods extend the most recent window. h]j)}(hhh](j)}(h}io.latency This takes a similar format as the other controllers. "MAJOR:MINOR target=" h](j)}(h io.latencyh]h io.latency}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj9ubj)}(hhh](h)}(h5This takes a similar format as the other controllers.h]h5This takes a similar format as the other controllers.}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj9ubj)}(h3"MAJOR:MINOR target=" h]h)}(h2"MAJOR:MINOR target="h]h6“MAJOR:MINOR target=”}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj9ubah}(h]h ]h"]h$]h&]uh1jhhhMhj9ubeh}(h]h ]h"]h$]h&]uh1jhj9ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj9ubj)}(hXio.stat If the controller is enabled you will see extra stats in io.stat in addition to the normal ones. depth This is the current queue depth for the group. avg_lat This is an exponential moving average with a decay rate of 1/exp bound by the sampling interval. The decay rate interval can be calculated by multiplying the win value in io.stat by the corresponding number of samples based on the win value. win The sampling window size in milliseconds. This is the minimum duration of time between evaluation events. Windows only elapse with IO activity. Idle periods extend the most recent window. h](j)}(hio.stath]hio.stat}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj:ubj)}(hhh](h)}(h`If the controller is enabled you will see extra stats in io.stat in addition to the normal ones.h]h`If the controller is enabled you will see extra stats in io.stat in addition to the normal ones.}(hj-:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj*:ubj)}(hX%depth This is the current queue depth for the group. avg_lat This is an exponential moving average with a decay rate of 1/exp bound by the sampling interval. The decay rate interval can be calculated by multiplying the win value in io.stat by the corresponding number of samples based on the win value. win The sampling window size in milliseconds. This is the minimum duration of time between evaluation events. Windows only elapse with IO activity. Idle periods extend the most recent window. h]j)}(hhh](j)}(h5depth This is the current queue depth for the group. h](j)}(hdepthh]hdepth}(hjF:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjB:ubj)}(hhh]h)}(h.This is the current queue depth for the group.h]h.This is the current queue depth for the group.}(hjW:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjT:ubah}(h]h ]h"]h$]h&]uh1jhjB:ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj?:ubj)}(havg_lat This is an exponential moving average with a decay rate of 1/exp bound by the sampling interval. The decay rate interval can be calculated by multiplying the win value in io.stat by the corresponding number of samples based on the win value. h](j)}(havg_lath]havg_lat}(hju:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjq:ubj)}(hhh]h)}(hThis is an exponential moving average with a decay rate of 1/exp bound by the sampling interval. The decay rate interval can be calculated by multiplying the win value in io.stat by the corresponding number of samples based on the win value.h]hThis is an exponential moving average with a decay rate of 1/exp bound by the sampling interval. The decay rate interval can be calculated by multiplying the win value in io.stat by the corresponding number of samples based on the win value.}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj:ubah}(h]h ]h"]h$]h&]uh1jhjq:ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj?:ubj)}(hwin The sampling window size in milliseconds. This is the minimum duration of time between evaluation events. Windows only elapse with IO activity. Idle periods extend the most recent window. h](j)}(hwinh]hwin}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj:ubj)}(hhh]h)}(hThe sampling window size in milliseconds. This is the minimum duration of time between evaluation events. Windows only elapse with IO activity. Idle periods extend the most recent window.h]hThe sampling window size in milliseconds. This is the minimum duration of time between evaluation events. Windows only elapse with IO activity. Idle periods extend the most recent window.}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj:ubah}(h]h ]h"]h$]h&]uh1jhj:ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj?:ubeh}(h]h ]h"]h$]h&]uh1jhj;:ubah}(h]h ]h"]h$]h&]uh1jhhhMhj*:ubeh}(h]h ]h"]h$]h&]uh1jhj:ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj9ubeh}(h]h ]h"]h$]h&]uh1jhj9ubah}(h]h ]h"]h$]h&]uh1jhhhMhj9hhubeh}(h]io-latency-interface-filesah ]h"]io latency interface filesah$]h&]uh1hhj.hhhhhM}ubh)}(hhh](h)}(h IO Priorityh]h IO Priority}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj:hhhhhMubh)}(hA single attribute controls the behavior of the I/O priority cgroup policy, namely the io.prio.class attribute. The following values are accepted for that attribute:h]hA single attribute controls the behavior of the I/O priority cgroup policy, namely the io.prio.class attribute. The following values are accepted for that attribute:}(hj ;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj:hhubj)}(hXno-change Do not modify the I/O priority class. promote-to-rt For requests that have a non-RT I/O priority class, change it into RT. Also change the priority level of these requests to 4. Do not modify the I/O priority of requests that have priority class RT. restrict-to-be For requests that do not have an I/O priority class or that have I/O priority class RT, change it into BE. Also change the priority level of these requests to 0. Do not modify the I/O priority class of requests that have priority class IDLE. idle Change the I/O priority class of all requests into IDLE, the lowest I/O priority class. none-to-rt Deprecated. Just an alias for promote-to-rt. h]j)}(hhh](j)}(h0no-change Do not modify the I/O priority class. h](j)}(h no-changeh]h no-change}(hj%;hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj!;ubj)}(hhh]h)}(h%Do not modify the I/O priority class.h]h%Do not modify the I/O priority class.}(hj6;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj3;ubah}(h]h ]h"]h$]h&]uh1jhj!;ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj;ubj)}(hpromote-to-rt For requests that have a non-RT I/O priority class, change it into RT. Also change the priority level of these requests to 4. Do not modify the I/O priority of requests that have priority class RT. h](j)}(h promote-to-rth]h promote-to-rt}(hjT;hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjP;ubj)}(hhh]h)}(hFor requests that have a non-RT I/O priority class, change it into RT. Also change the priority level of these requests to 4. Do not modify the I/O priority of requests that have priority class RT.h]hFor requests that have a non-RT I/O priority class, change it into RT. Also change the priority level of these requests to 4. Do not modify the I/O priority of requests that have priority class RT.}(hje;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjb;ubah}(h]h ]h"]h$]h&]uh1jhjP;ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj;ubj)}(hXrestrict-to-be For requests that do not have an I/O priority class or that have I/O priority class RT, change it into BE. Also change the priority level of these requests to 0. Do not modify the I/O priority class of requests that have priority class IDLE. h](j)}(hrestrict-to-beh]hrestrict-to-be}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj;ubj)}(hhh]h)}(hFor requests that do not have an I/O priority class or that have I/O priority class RT, change it into BE. Also change the priority level of these requests to 0. Do not modify the I/O priority class of requests that have priority class IDLE.h]hFor requests that do not have an I/O priority class or that have I/O priority class RT, change it into BE. Also change the priority level of these requests to 0. Do not modify the I/O priority class of requests that have priority class IDLE.}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj;ubah}(h]h ]h"]h$]h&]uh1jhj;ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj;ubj)}(h]idle Change the I/O priority class of all requests into IDLE, the lowest I/O priority class. h](j)}(hidleh]hidle}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj;ubj)}(hhh]h)}(hWChange the I/O priority class of all requests into IDLE, the lowest I/O priority class.h]hWChange the I/O priority class of all requests into IDLE, the lowest I/O priority class.}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj;ubah}(h]h ]h"]h$]h&]uh1jhj;ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj;ubj)}(h8none-to-rt Deprecated. Just an alias for promote-to-rt. h](j)}(h none-to-rth]h none-to-rt}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj;ubj)}(hhh]h)}(h,Deprecated. Just an alias for promote-to-rt.h]h,Deprecated. Just an alias for promote-to-rt.}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj;ubah}(h]h ]h"]h$]h&]uh1jhj;ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj;ubeh}(h]h ]h"]h$]h&]uh1jhj;ubah}(h]h ]h"]h$]h&]uh1jhhhMhj:hhubh)}(hMThe following numerical values are associated with the I/O priority policies:h]hMThe following numerical values are associated with the I/O priority policies:}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj:hhubj)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhj)<ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhj)<ubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h no-changeh]h no-change}(hjI<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjF<ubah}(h]h ]h"]h$]h&]uh1jhjC<ubj)}(hhh]h)}(h0h]h0}(hj`<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj]<ubah}(h]h ]h"]h$]h&]uh1jhjC<ubeh}(h]h ]h"]h$]h&]uh1jhj@<ubj)}(hhh](j)}(hhh]h)}(h promote-to-rth]h promote-to-rt}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj}<ubah}(h]h ]h"]h$]h&]uh1jhjz<ubj)}(hhh]h)}(h1h]h1}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj<ubah}(h]h ]h"]h$]h&]uh1jhjz<ubeh}(h]h ]h"]h$]h&]uh1jhj@<ubj)}(hhh](j)}(hhh]h)}(hrestrict-to-beh]hrestrict-to-be}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj<ubah}(h]h ]h"]h$]h&]uh1jhj<ubj)}(hhh]h)}(h2h]h2}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj<ubah}(h]h ]h"]h$]h&]uh1jhj<ubeh}(h]h ]h"]h$]h&]uh1jhj@<ubj)}(hhh](j)}(hhh]h)}(hidleh]hidle}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj<ubah}(h]h ]h"]h$]h&]uh1jhj<ubj)}(hhh]h)}(h3h]h3}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj=ubah}(h]h ]h"]h$]h&]uh1jhj<ubeh}(h]h ]h"]h$]h&]uh1jhj@<ubeh}(h]h ]h"]h$]h&]uh1jhj)<ubeh}(h]h ]h"]h$]h&]colsKuh1jhj&<ubah}(h]h ]h"]h$]h&]uh1jhj:hhhhhNubh)}(hNThe numerical value that corresponds to each I/O priority class is as follows:h]hNThe numerical value that corresponds to each I/O priority class is as follows:}(hj2=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj:hhubj)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjC=ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjC=ubj)}(hhh](j)}(hhh](j)}(hhh]h)}(hIOPRIO_CLASS_NONEh]hIOPRIO_CLASS_NONE}(hjc=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj`=ubah}(h]h ]h"]h$]h&]uh1jhj]=ubj)}(hhh]h)}(hjb<h]h0}(hjz=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjw=ubah}(h]h ]h"]h$]h&]uh1jhj]=ubeh}(h]h ]h"]h$]h&]uh1jhjZ=ubj)}(hhh](j)}(hhh]h)}(hIOPRIO_CLASS_RT (real-time)h]hIOPRIO_CLASS_RT (real-time)}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj=ubah}(h]h ]h"]h$]h&]uh1jhj=ubj)}(hhh]h)}(hj<h]h1}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj=ubah}(h]h ]h"]h$]h&]uh1jhj=ubeh}(h]h ]h"]h$]h&]uh1jhjZ=ubj)}(hhh](j)}(hhh]h)}(hIOPRIO_CLASS_BE (best effort)h]hIOPRIO_CLASS_BE (best effort)}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj=ubah}(h]h ]h"]h$]h&]uh1jhj=ubj)}(hhh]h)}(hj<h]h2}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj=ubah}(h]h ]h"]h$]h&]uh1jhj=ubeh}(h]h ]h"]h$]h&]uh1jhjZ=ubj)}(hhh](j)}(hhh]h)}(hIOPRIO_CLASS_IDLEh]hIOPRIO_CLASS_IDLE}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj>ubah}(h]h ]h"]h$]h&]uh1jhj=ubj)}(hhh]h)}(hj=h]h3}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj>ubah}(h]h ]h"]h$]h&]uh1jhj=ubeh}(h]h ]h"]h$]h&]uh1jhjZ=ubeh}(h]h ]h"]h$]h&]uh1jhjC=ubeh}(h]h ]h"]h$]h&]colsKuh1jhj@=ubah}(h]h ]h"]h$]h&]uh1jhj:hhhhhNubh)}(hHThe algorithm to set the I/O priority class for a request is as follows:h]hHThe algorithm to set the I/O priority class for a request is as follows:}(hjH>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj:hhubj)}(hhh](j)}(hIf I/O priority class policy is promote-to-rt, change the request I/O priority class to IOPRIO_CLASS_RT and change the request I/O priority level to 4.h]h)}(hIf I/O priority class policy is promote-to-rt, change the request I/O priority class to IOPRIO_CLASS_RT and change the request I/O priority level to 4.h]hIf I/O priority class policy is promote-to-rt, change the request I/O priority class to IOPRIO_CLASS_RT and change the request I/O priority level to 4.}(hj]>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjY>ubah}(h]h ]h"]h$]h&]uh1jhjV>hhhhhNubj)}(hIf I/O priority class policy is not promote-to-rt, translate the I/O priority class policy into a number, then change the request I/O priority class into the maximum of the I/O priority class policy number and the numerical I/O priority class. h]h)}(hIf I/O priority class policy is not promote-to-rt, translate the I/O priority class policy into a number, then change the request I/O priority class into the maximum of the I/O priority class policy number and the numerical I/O priority class.h]hIf I/O priority class policy is not promote-to-rt, translate the I/O priority class policy into a number, then change the request I/O priority class into the maximum of the I/O priority class policy number and the numerical I/O priority class.}(hju>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjq>ubah}(h]h ]h"]h$]h&]uh1jhjV>hhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhMhj:hhubeh}(h] io-priorityah ]h"] io priorityah$]h&]uh1hhj.hhhhhMubeh}(h]ioah ]h"]ioah$]h&]uh1hhjhhhhhMHubh)}(hhh](h)}(hPIDh]hPID}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj>hhhhhMubh)}(hThe process number controller is used to allow a cgroup to stop any new tasks from being fork()'d or clone()'d after a specified limit is reached.h]hThe process number controller is used to allow a cgroup to stop any new tasks from being fork()’d or clone()’d after a specified limit is reached.}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj>hhubh)}(hThe number of tasks in a cgroup can be exhausted in ways which other controllers cannot prevent, thus warranting its own controller. For example, a fork bomb is likely to exhaust the number of tasks before hitting memory restrictions.h]hThe number of tasks in a cgroup can be exhausted in ways which other controllers cannot prevent, thus warranting its own controller. For example, a fork bomb is likely to exhaust the number of tasks before hitting memory restrictions.}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj>hhubh)}(hXNote that PIDs used in this controller refer to TIDs, process IDs as used by the kernel.h]hXNote that PIDs used in this controller refer to TIDs, process IDs as used by the kernel.}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj>hhubh)}(hhh](h)}(hPID Interface Filesh]hPID Interface Files}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj>hhhhhMubj)}(hXDpids.max A read-write single value file which exists on non-root cgroups. The default is "max". Hard limit of number of processes. pids.current A read-only single value file which exists on non-root cgroups. The number of processes currently in the cgroup and its descendants. pids.peak A read-only single value file which exists on non-root cgroups. The maximum value that the number of processes in the cgroup and its descendants has ever reached. pids.events A read-only flat-keyed file which exists on non-root cgroups. Unless specified otherwise, a value change in this file generates a file modified event. The following entries are defined. max The number of times the cgroup's total number of processes hit the pids.max limit (see also pids_localevents). pids.events.local Similar to pids.events but the fields in the file are local to the cgroup i.e. not hierarchical. The file modified event generated on this file reflects only the local events. h]j)}(hhh](j)}(hpids.max A read-write single value file which exists on non-root cgroups. The default is "max". Hard limit of number of processes. h](j)}(hpids.maxh]hpids.max}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj>ubj)}(hhh](h)}(hWA read-write single value file which exists on non-root cgroups. The default is "max".h]h[A read-write single value file which exists on non-root cgroups. The default is “max”.}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj?ubh)}(h"Hard limit of number of processes.h]h"Hard limit of number of processes.}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj?ubeh}(h]h ]h"]h$]h&]uh1jhj>ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj>ubj)}(hpids.current A read-only single value file which exists on non-root cgroups. The number of processes currently in the cgroup and its descendants. h](j)}(h pids.currenth]h pids.current}(hj3?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj/?ubj)}(hhh](h)}(h?A read-only single value file which exists on non-root cgroups.h]h?A read-only single value file which exists on non-root cgroups.}(hjD?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjA?ubh)}(hDThe number of processes currently in the cgroup and its descendants.h]hDThe number of processes currently in the cgroup and its descendants.}(hjR?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjA?ubeh}(h]h ]h"]h$]h&]uh1jhj/?ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj>ubj)}(hpids.peak A read-only single value file which exists on non-root cgroups. The maximum value that the number of processes in the cgroup and its descendants has ever reached. h](j)}(h pids.peakh]h pids.peak}(hjp?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjl?ubj)}(hhh](h)}(h?A read-only single value file which exists on non-root cgroups.h]h?A read-only single value file which exists on non-root cgroups.}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj~?ubh)}(hbThe maximum value that the number of processes in the cgroup and its descendants has ever reached.h]hbThe maximum value that the number of processes in the cgroup and its descendants has ever reached.}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj~?ubeh}(h]h ]h"]h$]h&]uh1jhjl?ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj>ubj)}(hXLpids.events A read-only flat-keyed file which exists on non-root cgroups. Unless specified otherwise, a value change in this file generates a file modified event. The following entries are defined. max The number of times the cgroup's total number of processes hit the pids.max limit (see also pids_localevents). h](j)}(h pids.eventsh]h pids.events}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hj?ubj)}(hhh](h)}(hA read-only flat-keyed file which exists on non-root cgroups. Unless specified otherwise, a value change in this file generates a file modified event. The following entries are defined.h]hA read-only flat-keyed file which exists on non-root cgroups. Unless specified otherwise, a value change in this file generates a file modified event. The following entries are defined.}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj?ubj)}(hmax The number of times the cgroup's total number of processes hit the pids.max limit (see also pids_localevents). h]j)}(hhh]j)}(hsmax The number of times the cgroup's total number of processes hit the pids.max limit (see also pids_localevents). h](j)}(hmaxh]hmax}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hj?ubj)}(hhh]h)}(hnThe number of times the cgroup's total number of processes hit the pids.max limit (see also pids_localevents).h]hpThe number of times the cgroup’s total number of processes hit the pids.max limit (see also pids_localevents).}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj?ubah}(h]h ]h"]h$]h&]uh1jhj?ubeh}(h]h ]h"]h$]h&]uh1jhhhM hj?ubah}(h]h ]h"]h$]h&]uh1jhj?ubah}(h]h ]h"]h$]h&]uh1jhhhMhj?ubeh}(h]h ]h"]h$]h&]uh1jhj?ubeh}(h]h ]h"]h$]h&]uh1jhhhM hj>ubj)}(hpids.events.local Similar to pids.events but the fields in the file are local to the cgroup i.e. not hierarchical. The file modified event generated on this file reflects only the local events. h](j)}(hpids.events.localh]hpids.events.local}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hj@ubj)}(hhh]h)}(hSimilar to pids.events but the fields in the file are local to the cgroup i.e. not hierarchical. The file modified event generated on this file reflects only the local events.h]hSimilar to pids.events but the fields in the file are local to the cgroup i.e. not hierarchical. The file modified event generated on this file reflects only the local events.}(hj/@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj,@ubah}(h]h ]h"]h$]h&]uh1jhj@ubeh}(h]h ]h"]h$]h&]uh1jhhhM hj>ubeh}(h]h ]h"]h$]h&]uh1jhj>ubah}(h]h ]h"]h$]h&]uh1jhhhMhj>hhubh)}(hXOrganisational operations are not blocked by cgroup policies, so it is possible to have pids.current > pids.max. This can be done by either setting the limit to be smaller than pids.current, or attaching enough processes to the cgroup such that pids.current is larger than pids.max. However, it is not possible to violate a cgroup PID policy through fork() or clone(). These will return -EAGAIN if the creation of a new process would cause a cgroup policy to be violated.h]hXOrganisational operations are not blocked by cgroup policies, so it is possible to have pids.current > pids.max. This can be done by either setting the limit to be smaller than pids.current, or attaching enough processes to the cgroup such that pids.current is larger than pids.max. However, it is not possible to violate a cgroup PID policy through fork() or clone(). These will return -EAGAIN if the creation of a new process would cause a cgroup policy to be violated.}(hjU@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj>hhubeh}(h]pid-interface-filesah ]h"]pid interface filesah$]h&]uh1hhj>hhhhhMubeh}(h]pidah ]h"]pidah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hCpuseth]hCpuset}(hjv@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjs@hhhhhM ubh)}(hXThe "cpuset" controller provides a mechanism for constraining the CPU and memory node placement of tasks to only the resources specified in the cpuset interface files in a task's current cgroup. This is especially valuable on large NUMA systems where placing jobs on properly sized subsets of the systems with careful processor and memory placement to reduce cross-node memory access and contention can improve overall system performance.h]hXThe “cpuset” controller provides a mechanism for constraining the CPU and memory node placement of tasks to only the resources specified in the cpuset interface files in a task’s current cgroup. This is especially valuable on large NUMA systems where placing jobs on properly sized subsets of the systems with careful processor and memory placement to reduce cross-node memory access and contention can improve overall system performance.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjs@hhubh)}(h~The "cpuset" controller is hierarchical. That means the controller cannot use CPUs or memory nodes not allowed in its parent.h]hThe “cpuset” controller is hierarchical. That means the controller cannot use CPUs or memory nodes not allowed in its parent.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjs@hhubh)}(hhh](h)}(hCpuset Interface Filesh]hCpuset Interface Files}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj@hhhhhM ubj)}(hXn-cpuset.cpus A read-write multiple values file which exists on non-root cpuset-enabled cgroups. It lists the requested CPUs to be used by tasks within this cgroup. The actual list of CPUs to be granted, however, is subjected to constraints imposed by its parent and can differ from the requested CPUs. The CPU numbers are comma-separated numbers or ranges. For example:: # cat cpuset.cpus 0-4,6,8-10 An empty value indicates that the cgroup is using the same setting as the nearest cgroup ancestor with a non-empty "cpuset.cpus" or all the available CPUs if none is found. The value of "cpuset.cpus" stays constant until the next update and won't be affected by any CPU hotplug events. cpuset.cpus.effective A read-only multiple values file which exists on all cpuset-enabled cgroups. It lists the onlined CPUs that are actually granted to this cgroup by its parent. These CPUs are allowed to be used by tasks within the current cgroup. If "cpuset.cpus" is empty, the "cpuset.cpus.effective" file shows all the CPUs from the parent cgroup that can be available to be used by this cgroup. Otherwise, it should be a subset of "cpuset.cpus" unless none of the CPUs listed in "cpuset.cpus" can be granted. In this case, it will be treated just like an empty "cpuset.cpus". Its value will be affected by CPU hotplug events. cpuset.mems A read-write multiple values file which exists on non-root cpuset-enabled cgroups. It lists the requested memory nodes to be used by tasks within this cgroup. The actual list of memory nodes granted, however, is subjected to constraints imposed by its parent and can differ from the requested memory nodes. The memory node numbers are comma-separated numbers or ranges. For example:: # cat cpuset.mems 0-1,3 An empty value indicates that the cgroup is using the same setting as the nearest cgroup ancestor with a non-empty "cpuset.mems" or all the available memory nodes if none is found. The value of "cpuset.mems" stays constant until the next update and won't be affected by any memory nodes hotplug events. Setting a non-empty value to "cpuset.mems" causes memory of tasks within the cgroup to be migrated to the designated nodes if they are currently using memory outside of the designated nodes. There is a cost for this memory migration. The migration may not be complete and some memory pages may be left behind. So it is recommended that "cpuset.mems" should be set properly before spawning new tasks into the cpuset. Even if there is a need to change "cpuset.mems" with active tasks, it shouldn't be done frequently. cpuset.mems.effective A read-only multiple values file which exists on all cpuset-enabled cgroups. It lists the onlined memory nodes that are actually granted to this cgroup by its parent. These memory nodes are allowed to be used by tasks within the current cgroup. If "cpuset.mems" is empty, it shows all the memory nodes from the parent cgroup that will be available to be used by this cgroup. Otherwise, it should be a subset of "cpuset.mems" unless none of the memory nodes listed in "cpuset.mems" can be granted. In this case, it will be treated just like an empty "cpuset.mems". Its value will be affected by memory nodes hotplug events. cpuset.cpus.exclusive A read-write multiple values file which exists on non-root cpuset-enabled cgroups. It lists all the exclusive CPUs that are allowed to be used to create a new cpuset partition. Its value is not used unless the cgroup becomes a valid partition root. See the "cpuset.cpus.partition" section below for a description of what a cpuset partition is. When the cgroup becomes a partition root, the actual exclusive CPUs that are allocated to that partition are listed in "cpuset.cpus.exclusive.effective" which may be different from "cpuset.cpus.exclusive". If "cpuset.cpus.exclusive" has previously been set, "cpuset.cpus.exclusive.effective" is always a subset of it. Users can manually set it to a value that is different from "cpuset.cpus". One constraint in setting it is that the list of CPUs must be exclusive with respect to "cpuset.cpus.exclusive" of its sibling. If "cpuset.cpus.exclusive" of a sibling cgroup isn't set, its "cpuset.cpus" value, if set, cannot be a subset of it to leave at least one CPU available when the exclusive CPUs are taken away. For a parent cgroup, any one of its exclusive CPUs can only be distributed to at most one of its child cgroups. Having an exclusive CPU appearing in two or more of its child cgroups is not allowed (the exclusivity rule). A value that violates the exclusivity rule will be rejected with a write error. The root cgroup is a partition root and all its available CPUs are in its exclusive CPU set. cpuset.cpus.exclusive.effective A read-only multiple values file which exists on all non-root cpuset-enabled cgroups. This file shows the effective set of exclusive CPUs that can be used to create a partition root. The content of this file will always be a subset of its parent's "cpuset.cpus.exclusive.effective" if its parent is not the root cgroup. It will also be a subset of "cpuset.cpus.exclusive" if it is set. If "cpuset.cpus.exclusive" is not set, it is treated to have an implicit value of "cpuset.cpus" in the formation of local partition. cpuset.cpus.isolated A read-only and root cgroup only multiple values file. This file shows the set of all isolated CPUs used in existing isolated partitions. It will be empty if no isolated partition is created. cpuset.cpus.partition A read-write single value file which exists on non-root cpuset-enabled cgroups. This flag is owned by the parent cgroup and is not delegatable. It accepts only the following input values when written to. ========== ===================================== "member" Non-root member of a partition "root" Partition root "isolated" Partition root without load balancing ========== ===================================== A cpuset partition is a collection of cpuset-enabled cgroups with a partition root at the top of the hierarchy and its descendants except those that are separate partition roots themselves and their descendants. A partition has exclusive access to the set of exclusive CPUs allocated to it. Other cgroups outside of that partition cannot use any CPUs in that set. There are two types of partitions - local and remote. A local partition is one whose parent cgroup is also a valid partition root. A remote partition is one whose parent cgroup is not a valid partition root itself. Writing to "cpuset.cpus.exclusive" is optional for the creation of a local partition as its "cpuset.cpus.exclusive" file will assume an implicit value that is the same as "cpuset.cpus" if it is not set. Writing the proper "cpuset.cpus.exclusive" values down the cgroup hierarchy before the target partition root is mandatory for the creation of a remote partition. Currently, a remote partition cannot be created under a local partition. All the ancestors of a remote partition root except the root cgroup cannot be a partition root. The root cgroup is always a partition root and its state cannot be changed. All other non-root cgroups start out as "member". When set to "root", the current cgroup is the root of a new partition or scheduling domain. The set of exclusive CPUs is determined by the value of its "cpuset.cpus.exclusive.effective". When set to "isolated", the CPUs in that partition will be in an isolated state without any load balancing from the scheduler and excluded from the unbound workqueues. Tasks placed in such a partition with multiple CPUs should be carefully distributed and bound to each of the individual CPUs for optimal performance. A partition root ("root" or "isolated") can be in one of the two possible states - valid or invalid. An invalid partition root is in a degraded state where some state information may be retained, but behaves more like a "member". All possible state transitions among "member", "root" and "isolated" are allowed. On read, the "cpuset.cpus.partition" file can show the following values. ============================= ===================================== "member" Non-root member of a partition "root" Partition root "isolated" Partition root without load balancing "root invalid ()" Invalid partition root "isolated invalid ()" Invalid isolated partition root ============================= ===================================== In the case of an invalid partition root, a descriptive string on why the partition is invalid is included within parentheses. For a local partition root to be valid, the following conditions must be met. 1) The parent cgroup is a valid partition root. 2) The "cpuset.cpus.exclusive.effective" file cannot be empty, though it may contain offline CPUs. 3) The "cpuset.cpus.effective" cannot be empty unless there is no task associated with this partition. For a remote partition root to be valid, all the above conditions except the first one must be met. External events like hotplug or changes to "cpuset.cpus" or "cpuset.cpus.exclusive" can cause a valid partition root to become invalid and vice versa. Note that a task cannot be moved to a cgroup with empty "cpuset.cpus.effective". A valid non-root parent partition may distribute out all its CPUs to its child local partitions when there is no task associated with it. Care must be taken to change a valid partition root to "member" as all its child local partitions, if present, will become invalid causing disruption to tasks running in those child partitions. These inactivated partitions could be recovered if their parent is switched back to a partition root with a proper value in "cpuset.cpus" or "cpuset.cpus.exclusive". Poll and inotify events are triggered whenever the state of "cpuset.cpus.partition" changes. That includes changes caused by write to "cpuset.cpus.partition", cpu hotplug or other changes that modify the validity status of the partition. This will allow user space agents to monitor unexpected changes to "cpuset.cpus.partition" without the need to do continuous polling. A user can pre-configure certain CPUs to an isolated state with load balancing disabled at boot time with the "isolcpus" kernel boot command line option. If those CPUs are to be put into a partition, they have to be used in an isolated partition. h]j)}(hhh](j)}(hXcpuset.cpus A read-write multiple values file which exists on non-root cpuset-enabled cgroups. It lists the requested CPUs to be used by tasks within this cgroup. The actual list of CPUs to be granted, however, is subjected to constraints imposed by its parent and can differ from the requested CPUs. The CPU numbers are comma-separated numbers or ranges. For example:: # cat cpuset.cpus 0-4,6,8-10 An empty value indicates that the cgroup is using the same setting as the nearest cgroup ancestor with a non-empty "cpuset.cpus" or all the available CPUs if none is found. The value of "cpuset.cpus" stays constant until the next update and won't be affected by any CPU hotplug events. h](j)}(h cpuset.cpush]h cpuset.cpus}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM6 hj@ubj)}(hhh](h)}(hRA read-write multiple values file which exists on non-root cpuset-enabled cgroups.h]hRA read-write multiple values file which exists on non-root cpuset-enabled cgroups.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM# hj@ubh)}(hIt lists the requested CPUs to be used by tasks within this cgroup. The actual list of CPUs to be granted, however, is subjected to constraints imposed by its parent and can differ from the requested CPUs.h]hIt lists the requested CPUs to be used by tasks within this cgroup. The actual list of CPUs to be granted, however, is subjected to constraints imposed by its parent and can differ from the requested CPUs.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM& hj@ubh)}(hDThe CPU numbers are comma-separated numbers or ranges. For example::h]hCThe CPU numbers are comma-separated numbers or ranges. For example:}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM+ hj@ubjV)}(h# cat cpuset.cpus 0-4,6,8-10h]h# cat cpuset.cpus 0-4,6,8-10}hj@sbah}(h]h ]h"]h$]h&]jjuh1jUhhhM. hj@ubh)}(hAn empty value indicates that the cgroup is using the same setting as the nearest cgroup ancestor with a non-empty "cpuset.cpus" or all the available CPUs if none is found.h]hAn empty value indicates that the cgroup is using the same setting as the nearest cgroup ancestor with a non-empty “cpuset.cpus” or all the available CPUs if none is found.}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM1 hj@ubh)}(hpThe value of "cpuset.cpus" stays constant until the next update and won't be affected by any CPU hotplug events.h]hvThe value of “cpuset.cpus” stays constant until the next update and won’t be affected by any CPU hotplug events.}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM5 hj@ubeh}(h]h ]h"]h$]h&]uh1jhj@ubeh}(h]h ]h"]h$]h&]uh1jhhhM6 hj@ubj)}(hXcpuset.cpus.effective A read-only multiple values file which exists on all cpuset-enabled cgroups. It lists the onlined CPUs that are actually granted to this cgroup by its parent. These CPUs are allowed to be used by tasks within the current cgroup. If "cpuset.cpus" is empty, the "cpuset.cpus.effective" file shows all the CPUs from the parent cgroup that can be available to be used by this cgroup. Otherwise, it should be a subset of "cpuset.cpus" unless none of the CPUs listed in "cpuset.cpus" can be granted. In this case, it will be treated just like an empty "cpuset.cpus". Its value will be affected by CPU hotplug events. h](j)}(hcpuset.cpus.effectiveh]hcpuset.cpus.effective}(hj1AhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMG hj-Aubj)}(hhh](h)}(hLA read-only multiple values file which exists on all cpuset-enabled cgroups.h]hLA read-only multiple values file which exists on all cpuset-enabled cgroups.}(hjBAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM9 hj?Aubh)}(hIt lists the onlined CPUs that are actually granted to this cgroup by its parent. These CPUs are allowed to be used by tasks within the current cgroup.h]hIt lists the onlined CPUs that are actually granted to this cgroup by its parent. These CPUs are allowed to be used by tasks within the current cgroup.}(hjPAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM< hj?Aubh)}(hXMIf "cpuset.cpus" is empty, the "cpuset.cpus.effective" file shows all the CPUs from the parent cgroup that can be available to be used by this cgroup. Otherwise, it should be a subset of "cpuset.cpus" unless none of the CPUs listed in "cpuset.cpus" can be granted. In this case, it will be treated just like an empty "cpuset.cpus".h]hXaIf “cpuset.cpus” is empty, the “cpuset.cpus.effective” file shows all the CPUs from the parent cgroup that can be available to be used by this cgroup. Otherwise, it should be a subset of “cpuset.cpus” unless none of the CPUs listed in “cpuset.cpus” can be granted. In this case, it will be treated just like an empty “cpuset.cpus”.}(hj^AhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM@ hj?Aubh)}(h1Its value will be affected by CPU hotplug events.h]h1Its value will be affected by CPU hotplug events.}(hjlAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMG hj?Aubeh}(h]h ]h"]h$]h&]uh1jhj-Aubeh}(h]h ]h"]h$]h&]uh1jhhhMG hj@ubj)}(hXcpuset.mems A read-write multiple values file which exists on non-root cpuset-enabled cgroups. It lists the requested memory nodes to be used by tasks within this cgroup. The actual list of memory nodes granted, however, is subjected to constraints imposed by its parent and can differ from the requested memory nodes. The memory node numbers are comma-separated numbers or ranges. For example:: # cat cpuset.mems 0-1,3 An empty value indicates that the cgroup is using the same setting as the nearest cgroup ancestor with a non-empty "cpuset.mems" or all the available memory nodes if none is found. The value of "cpuset.mems" stays constant until the next update and won't be affected by any memory nodes hotplug events. Setting a non-empty value to "cpuset.mems" causes memory of tasks within the cgroup to be migrated to the designated nodes if they are currently using memory outside of the designated nodes. There is a cost for this memory migration. The migration may not be complete and some memory pages may be left behind. So it is recommended that "cpuset.mems" should be set properly before spawning new tasks into the cpuset. Even if there is a need to change "cpuset.mems" with active tasks, it shouldn't be done frequently. h](j)}(h cpuset.memsh]h cpuset.mems}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMi hjAubj)}(hhh](h)}(hRA read-write multiple values file which exists on non-root cpuset-enabled cgroups.h]hRA read-write multiple values file which exists on non-root cpuset-enabled cgroups.}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMJ hjAubh)}(hIt lists the requested memory nodes to be used by tasks within this cgroup. The actual list of memory nodes granted, however, is subjected to constraints imposed by its parent and can differ from the requested memory nodes.h]hIt lists the requested memory nodes to be used by tasks within this cgroup. The actual list of memory nodes granted, however, is subjected to constraints imposed by its parent and can differ from the requested memory nodes.}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMM hjAubh)}(hLThe memory node numbers are comma-separated numbers or ranges. For example::h]hKThe memory node numbers are comma-separated numbers or ranges. For example:}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMR hjAubjV)}(h# cat cpuset.mems 0-1,3h]h# cat cpuset.mems 0-1,3}hjAsbah}(h]h ]h"]h$]h&]jjuh1jUhhhMU hjAubh)}(hAn empty value indicates that the cgroup is using the same setting as the nearest cgroup ancestor with a non-empty "cpuset.mems" or all the available memory nodes if none is found.h]hAn empty value indicates that the cgroup is using the same setting as the nearest cgroup ancestor with a non-empty “cpuset.mems” or all the available memory nodes if none is found.}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMX hjAubh)}(hyThe value of "cpuset.mems" stays constant until the next update and won't be affected by any memory nodes hotplug events.h]hThe value of “cpuset.mems” stays constant until the next update and won’t be affected by any memory nodes hotplug events.}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM] hjAubh)}(hSetting a non-empty value to "cpuset.mems" causes memory of tasks within the cgroup to be migrated to the designated nodes if they are currently using memory outside of the designated nodes.h]hSetting a non-empty value to “cpuset.mems” causes memory of tasks within the cgroup to be migrated to the designated nodes if they are currently using memory outside of the designated nodes.}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM` hjAubh)}(hXFThere is a cost for this memory migration. The migration may not be complete and some memory pages may be left behind. So it is recommended that "cpuset.mems" should be set properly before spawning new tasks into the cpuset. Even if there is a need to change "cpuset.mems" with active tasks, it shouldn't be done frequently.h]hXPThere is a cost for this memory migration. The migration may not be complete and some memory pages may be left behind. So it is recommended that “cpuset.mems” should be set properly before spawning new tasks into the cpuset. Even if there is a need to change “cpuset.mems” with active tasks, it shouldn’t be done frequently.}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMd hjAubeh}(h]h ]h"]h$]h&]uh1jhjAubeh}(h]h ]h"]h$]h&]uh1jhhhMi hj@ubj)}(hXcpuset.mems.effective A read-only multiple values file which exists on all cpuset-enabled cgroups. It lists the onlined memory nodes that are actually granted to this cgroup by its parent. These memory nodes are allowed to be used by tasks within the current cgroup. If "cpuset.mems" is empty, it shows all the memory nodes from the parent cgroup that will be available to be used by this cgroup. Otherwise, it should be a subset of "cpuset.mems" unless none of the memory nodes listed in "cpuset.mems" can be granted. In this case, it will be treated just like an empty "cpuset.mems". Its value will be affected by memory nodes hotplug events. h](j)}(hcpuset.mems.effectiveh]hcpuset.mems.effective}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMy hjBubj)}(hhh](h)}(hLA read-only multiple values file which exists on all cpuset-enabled cgroups.h]hLA read-only multiple values file which exists on all cpuset-enabled cgroups.}(hj,BhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMl hj)Bubh)}(hIt lists the onlined memory nodes that are actually granted to this cgroup by its parent. These memory nodes are allowed to be used by tasks within the current cgroup.h]hIt lists the onlined memory nodes that are actually granted to this cgroup by its parent. These memory nodes are allowed to be used by tasks within the current cgroup.}(hj:BhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMo hj)Bubh)}(hX?If "cpuset.mems" is empty, it shows all the memory nodes from the parent cgroup that will be available to be used by this cgroup. Otherwise, it should be a subset of "cpuset.mems" unless none of the memory nodes listed in "cpuset.mems" can be granted. In this case, it will be treated just like an empty "cpuset.mems".h]hXOIf “cpuset.mems” is empty, it shows all the memory nodes from the parent cgroup that will be available to be used by this cgroup. Otherwise, it should be a subset of “cpuset.mems” unless none of the memory nodes listed in “cpuset.mems” can be granted. In this case, it will be treated just like an empty “cpuset.mems”.}(hjHBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMs hj)Bubh)}(h:Its value will be affected by memory nodes hotplug events.h]h:Its value will be affected by memory nodes hotplug events.}(hjVBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMy hj)Bubeh}(h]h ]h"]h$]h&]uh1jhjBubeh}(h]h ]h"]h$]h&]uh1jhhhMy hj@ubj)}(hXcpuset.cpus.exclusive A read-write multiple values file which exists on non-root cpuset-enabled cgroups. It lists all the exclusive CPUs that are allowed to be used to create a new cpuset partition. Its value is not used unless the cgroup becomes a valid partition root. See the "cpuset.cpus.partition" section below for a description of what a cpuset partition is. When the cgroup becomes a partition root, the actual exclusive CPUs that are allocated to that partition are listed in "cpuset.cpus.exclusive.effective" which may be different from "cpuset.cpus.exclusive". If "cpuset.cpus.exclusive" has previously been set, "cpuset.cpus.exclusive.effective" is always a subset of it. Users can manually set it to a value that is different from "cpuset.cpus". One constraint in setting it is that the list of CPUs must be exclusive with respect to "cpuset.cpus.exclusive" of its sibling. If "cpuset.cpus.exclusive" of a sibling cgroup isn't set, its "cpuset.cpus" value, if set, cannot be a subset of it to leave at least one CPU available when the exclusive CPUs are taken away. For a parent cgroup, any one of its exclusive CPUs can only be distributed to at most one of its child cgroups. Having an exclusive CPU appearing in two or more of its child cgroups is not allowed (the exclusivity rule). A value that violates the exclusivity rule will be rejected with a write error. The root cgroup is a partition root and all its available CPUs are in its exclusive CPU set. h](j)}(hcpuset.cpus.exclusiveh]hcpuset.cpus.exclusive}(hjtBhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjpBubj)}(hhh](h)}(hRA read-write multiple values file which exists on non-root cpuset-enabled cgroups.h]hRA read-write multiple values file which exists on non-root cpuset-enabled cgroups.}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM| hjBubh)}(hXIt lists all the exclusive CPUs that are allowed to be used to create a new cpuset partition. Its value is not used unless the cgroup becomes a valid partition root. See the "cpuset.cpus.partition" section below for a description of what a cpuset partition is.h]hX It lists all the exclusive CPUs that are allowed to be used to create a new cpuset partition. Its value is not used unless the cgroup becomes a valid partition root. See the “cpuset.cpus.partition” section below for a description of what a cpuset partition is.}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjBubh)}(hX>When the cgroup becomes a partition root, the actual exclusive CPUs that are allocated to that partition are listed in "cpuset.cpus.exclusive.effective" which may be different from "cpuset.cpus.exclusive". If "cpuset.cpus.exclusive" has previously been set, "cpuset.cpus.exclusive.effective" is always a subset of it.h]hXNWhen the cgroup becomes a partition root, the actual exclusive CPUs that are allocated to that partition are listed in “cpuset.cpus.exclusive.effective” which may be different from “cpuset.cpus.exclusive”. If “cpuset.cpus.exclusive” has previously been set, “cpuset.cpus.exclusive.effective” is always a subset of it.}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjBubh)}(hXUsers can manually set it to a value that is different from "cpuset.cpus". One constraint in setting it is that the list of CPUs must be exclusive with respect to "cpuset.cpus.exclusive" of its sibling. If "cpuset.cpus.exclusive" of a sibling cgroup isn't set, its "cpuset.cpus" value, if set, cannot be a subset of it to leave at least one CPU available when the exclusive CPUs are taken away.h]hXUsers can manually set it to a value that is different from “cpuset.cpus”. One constraint in setting it is that the list of CPUs must be exclusive with respect to “cpuset.cpus.exclusive” of its sibling. If “cpuset.cpus.exclusive” of a sibling cgroup isn’t set, its “cpuset.cpus” value, if set, cannot be a subset of it to leave at least one CPU available when the exclusive CPUs are taken away.}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjBubh)}(hX.For a parent cgroup, any one of its exclusive CPUs can only be distributed to at most one of its child cgroups. Having an exclusive CPU appearing in two or more of its child cgroups is not allowed (the exclusivity rule). A value that violates the exclusivity rule will be rejected with a write error.h]hX.For a parent cgroup, any one of its exclusive CPUs can only be distributed to at most one of its child cgroups. Having an exclusive CPU appearing in two or more of its child cgroups is not allowed (the exclusivity rule). A value that violates the exclusivity rule will be rejected with a write error.}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjBubh)}(h\The root cgroup is a partition root and all its available CPUs are in its exclusive CPU set.h]h\The root cgroup is a partition root and all its available CPUs are in its exclusive CPU set.}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjBubeh}(h]h ]h"]h$]h&]uh1jhjpBubeh}(h]h ]h"]h$]h&]uh1jhhhM hj@ubj)}(hX+cpuset.cpus.exclusive.effective A read-only multiple values file which exists on all non-root cpuset-enabled cgroups. This file shows the effective set of exclusive CPUs that can be used to create a partition root. The content of this file will always be a subset of its parent's "cpuset.cpus.exclusive.effective" if its parent is not the root cgroup. It will also be a subset of "cpuset.cpus.exclusive" if it is set. If "cpuset.cpus.exclusive" is not set, it is treated to have an implicit value of "cpuset.cpus" in the formation of local partition. h](j)}(hcpuset.cpus.exclusive.effectiveh]hcpuset.cpus.exclusive.effective}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjBubj)}(hhh](h)}(hUA read-only multiple values file which exists on all non-root cpuset-enabled cgroups.h]hUA read-only multiple values file which exists on all non-root cpuset-enabled cgroups.}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjBubh)}(hXThis file shows the effective set of exclusive CPUs that can be used to create a partition root. The content of this file will always be a subset of its parent's "cpuset.cpus.exclusive.effective" if its parent is not the root cgroup. It will also be a subset of "cpuset.cpus.exclusive" if it is set. If "cpuset.cpus.exclusive" is not set, it is treated to have an implicit value of "cpuset.cpus" in the formation of local partition.h]hXThis file shows the effective set of exclusive CPUs that can be used to create a partition root. The content of this file will always be a subset of its parent’s “cpuset.cpus.exclusive.effective” if its parent is not the root cgroup. It will also be a subset of “cpuset.cpus.exclusive” if it is set. If “cpuset.cpus.exclusive” is not set, it is treated to have an implicit value of “cpuset.cpus” in the formation of local partition.}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjBubeh}(h]h ]h"]h$]h&]uh1jhjBubeh}(h]h ]h"]h$]h&]uh1jhhhM hj@ubj)}(hcpuset.cpus.isolated A read-only and root cgroup only multiple values file. This file shows the set of all isolated CPUs used in existing isolated partitions. It will be empty if no isolated partition is created. h](j)}(hcpuset.cpus.isolatedh]hcpuset.cpus.isolated}(hj&ChhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hj"Cubj)}(hhh](h)}(h6A read-only and root cgroup only multiple values file.h]h6A read-only and root cgroup only multiple values file.}(hj7ChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj4Cubh)}(hThis file shows the set of all isolated CPUs used in existing isolated partitions. It will be empty if no isolated partition is created.h]hThis file shows the set of all isolated CPUs used in existing isolated partitions. It will be empty if no isolated partition is created.}(hjEChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj4Cubeh}(h]h ]h"]h$]h&]uh1jhj"Cubeh}(h]h ]h"]h$]h&]uh1jhhhM hj@ubj)}(hXucpuset.cpus.partition A read-write single value file which exists on non-root cpuset-enabled cgroups. This flag is owned by the parent cgroup and is not delegatable. It accepts only the following input values when written to. ========== ===================================== "member" Non-root member of a partition "root" Partition root "isolated" Partition root without load balancing ========== ===================================== A cpuset partition is a collection of cpuset-enabled cgroups with a partition root at the top of the hierarchy and its descendants except those that are separate partition roots themselves and their descendants. A partition has exclusive access to the set of exclusive CPUs allocated to it. Other cgroups outside of that partition cannot use any CPUs in that set. There are two types of partitions - local and remote. A local partition is one whose parent cgroup is also a valid partition root. A remote partition is one whose parent cgroup is not a valid partition root itself. Writing to "cpuset.cpus.exclusive" is optional for the creation of a local partition as its "cpuset.cpus.exclusive" file will assume an implicit value that is the same as "cpuset.cpus" if it is not set. Writing the proper "cpuset.cpus.exclusive" values down the cgroup hierarchy before the target partition root is mandatory for the creation of a remote partition. Currently, a remote partition cannot be created under a local partition. All the ancestors of a remote partition root except the root cgroup cannot be a partition root. The root cgroup is always a partition root and its state cannot be changed. All other non-root cgroups start out as "member". When set to "root", the current cgroup is the root of a new partition or scheduling domain. The set of exclusive CPUs is determined by the value of its "cpuset.cpus.exclusive.effective". When set to "isolated", the CPUs in that partition will be in an isolated state without any load balancing from the scheduler and excluded from the unbound workqueues. Tasks placed in such a partition with multiple CPUs should be carefully distributed and bound to each of the individual CPUs for optimal performance. A partition root ("root" or "isolated") can be in one of the two possible states - valid or invalid. An invalid partition root is in a degraded state where some state information may be retained, but behaves more like a "member". All possible state transitions among "member", "root" and "isolated" are allowed. On read, the "cpuset.cpus.partition" file can show the following values. ============================= ===================================== "member" Non-root member of a partition "root" Partition root "isolated" Partition root without load balancing "root invalid ()" Invalid partition root "isolated invalid ()" Invalid isolated partition root ============================= ===================================== In the case of an invalid partition root, a descriptive string on why the partition is invalid is included within parentheses. For a local partition root to be valid, the following conditions must be met. 1) The parent cgroup is a valid partition root. 2) The "cpuset.cpus.exclusive.effective" file cannot be empty, though it may contain offline CPUs. 3) The "cpuset.cpus.effective" cannot be empty unless there is no task associated with this partition. For a remote partition root to be valid, all the above conditions except the first one must be met. External events like hotplug or changes to "cpuset.cpus" or "cpuset.cpus.exclusive" can cause a valid partition root to become invalid and vice versa. Note that a task cannot be moved to a cgroup with empty "cpuset.cpus.effective". A valid non-root parent partition may distribute out all its CPUs to its child local partitions when there is no task associated with it. Care must be taken to change a valid partition root to "member" as all its child local partitions, if present, will become invalid causing disruption to tasks running in those child partitions. These inactivated partitions could be recovered if their parent is switched back to a partition root with a proper value in "cpuset.cpus" or "cpuset.cpus.exclusive". Poll and inotify events are triggered whenever the state of "cpuset.cpus.partition" changes. That includes changes caused by write to "cpuset.cpus.partition", cpu hotplug or other changes that modify the validity status of the partition. This will allow user space agents to monitor unexpected changes to "cpuset.cpus.partition" without the need to do continuous polling. A user can pre-configure certain CPUs to an isolated state with load balancing disabled at boot time with the "isolcpus" kernel boot command line option. If those CPUs are to be put into a partition, they have to be used in an isolated partition. h](j)}(hcpuset.cpus.partitionh]hcpuset.cpus.partition}(hjcChhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hj_Cubj)}(hhh](h)}(hA read-write single value file which exists on non-root cpuset-enabled cgroups. This flag is owned by the parent cgroup and is not delegatable.h]hA read-write single value file which exists on non-root cpuset-enabled cgroups. This flag is owned by the parent cgroup and is not delegatable.}(hjtChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjqCubh)}(h;It accepts only the following input values when written to.h]h;It accepts only the following input values when written to.}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjqCubj)}(h========== ===================================== "member" Non-root member of a partition "root" Partition root "isolated" Partition root without load balancing ========== ===================================== h]j)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jhjCubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK%uh1jhjCubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h"member"h]h “member”}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjCubah}(h]h ]h"]h$]h&]uh1jhjCubj)}(hhh]h)}(hNon-root member of a partitionh]hNon-root member of a partition}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjCubah}(h]h ]h"]h$]h&]uh1jhjCubeh}(h]h ]h"]h$]h&]uh1jhjCubj)}(hhh](j)}(hhh]h)}(h"root"h]h “root”}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjCubah}(h]h ]h"]h$]h&]uh1jhjCubj)}(hhh]h)}(hPartition rooth]hPartition root}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjDubah}(h]h ]h"]h$]h&]uh1jhjCubeh}(h]h ]h"]h$]h&]uh1jhjCubj)}(hhh](j)}(hhh]h)}(h "isolated"h]h“isolated”}(hj%DhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj"Dubah}(h]h ]h"]h$]h&]uh1jhjDubj)}(hhh]h)}(h%Partition root without load balancingh]h%Partition root without load balancing}(hjWhen set to "isolated", the CPUs in that partition will be in an isolated state without any load balancing from the scheduler and excluded from the unbound workqueues. Tasks placed in such a partition with multiple CPUs should be carefully distributed and bound to each of the individual CPUs for optimal performance.h]hXBWhen set to “isolated”, the CPUs in that partition will be in an isolated state without any load balancing from the scheduler and excluded from the unbound workqueues. Tasks placed in such a partition with multiple CPUs should be carefully distributed and bound to each of the individual CPUs for optimal performance.}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjqCubh)}(hA partition root ("root" or "isolated") can be in one of the two possible states - valid or invalid. An invalid partition root is in a degraded state where some state information may be retained, but behaves more like a "member".h]hA partition root (“root” or “isolated”) can be in one of the two possible states - valid or invalid. An invalid partition root is in a degraded state where some state information may be retained, but behaves more like a “member”.}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjqCubh)}(hQAll possible state transitions among "member", "root" and "isolated" are allowed.h]h]All possible state transitions among “member”, “root” and “isolated” are allowed.}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjqCubh)}(hHOn read, the "cpuset.cpus.partition" file can show the following values.h]hLOn read, the “cpuset.cpus.partition” file can show the following values.}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjqCubj)}(hX============================= ===================================== "member" Non-root member of a partition "root" Partition root "isolated" Partition root without load balancing "root invalid ()" Invalid partition root "isolated invalid ()" Invalid isolated partition root ============================= ===================================== h]j)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjDubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK%uh1jhjDubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h"member"h]h “member”}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjEubah}(h]h ]h"]h$]h&]uh1jhjEubj)}(hhh]h)}(hNon-root member of a partitionh]hNon-root member of a partition}(hj+EhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj(Eubah}(h]h ]h"]h$]h&]uh1jhjEubeh}(h]h ]h"]h$]h&]uh1jhj Eubj)}(hhh](j)}(hhh]h)}(h"root"h]h “root”}(hjKEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjHEubah}(h]h ]h"]h$]h&]uh1jhjEEubj)}(hhh]h)}(hPartition rooth]hPartition root}(hjbEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj_Eubah}(h]h ]h"]h$]h&]uh1jhjEEubeh}(h]h ]h"]h$]h&]uh1jhj Eubj)}(hhh](j)}(hhh]h)}(h "isolated"h]h“isolated”}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjEubah}(h]h ]h"]h$]h&]uh1jhj|Eubj)}(hhh]h)}(h%Partition root without load balancingh]h%Partition root without load balancing}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjEubah}(h]h ]h"]h$]h&]uh1jhj|Eubeh}(h]h ]h"]h$]h&]uh1jhj Eubj)}(hhh](j)}(hhh]h)}(h"root invalid ()"h]h“root invalid ()”}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjEubah}(h]h ]h"]h$]h&]uh1jhjEubj)}(hhh]h)}(hInvalid partition rooth]hInvalid partition root}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjEubah}(h]h ]h"]h$]h&]uh1jhjEubeh}(h]h ]h"]h$]h&]uh1jhj Eubj)}(hhh](j)}(hhh]h)}(h"isolated invalid ()"h]h!“isolated invalid ()”}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjEubah}(h]h ]h"]h$]h&]uh1jhjEubj)}(hhh]h)}(hInvalid isolated partition rooth]hInvalid isolated partition root}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjFubah}(h]h ]h"]h$]h&]uh1jhjEubeh}(h]h ]h"]h$]h&]uh1jhj Eubeh}(h]h ]h"]h$]h&]uh1jhjDubeh}(h]h ]h"]h$]h&]colsKuh1jhjDubah}(h]h ]h"]h$]h&]uh1jhjDubah}(h]h ]h"]h$]h&]uh1jhhhM hjqCubh)}(h~In the case of an invalid partition root, a descriptive string on why the partition is invalid is included within parentheses.h]h~In the case of an invalid partition root, a descriptive string on why the partition is invalid is included within parentheses.}(hj:FhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjqCubh)}(hMFor a local partition root to be valid, the following conditions must be met.h]hMFor a local partition root to be valid, the following conditions must be met.}(hjHFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjqCubhenumerated_list)}(hhh](j)}(h,The parent cgroup is a valid partition root.h]h)}(hj]Fh]h,The parent cgroup is a valid partition root.}(hj_FhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj[Fubah}(h]h ]h"]h$]h&]uh1jhjXFubj)}(h_The "cpuset.cpus.exclusive.effective" file cannot be empty, though it may contain offline CPUs.h]h)}(h_The "cpuset.cpus.exclusive.effective" file cannot be empty, though it may contain offline CPUs.h]hcThe “cpuset.cpus.exclusive.effective” file cannot be empty, though it may contain offline CPUs.}(hjvFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjrFubah}(h]h ]h"]h$]h&]uh1jhjXFubj)}(hdThe "cpuset.cpus.effective" cannot be empty unless there is no task associated with this partition. h]h)}(hcThe "cpuset.cpus.effective" cannot be empty unless there is no task associated with this partition.h]hgThe “cpuset.cpus.effective” cannot be empty unless there is no task associated with this partition.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjFubah}(h]h ]h"]h$]h&]uh1jhjXFubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix)uh1jVFhjqCubh)}(hcFor a remote partition root to be valid, all the above conditions except the first one must be met.h]hcFor a remote partition root to be valid, all the above conditions except the first one must be met.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjqCubh)}(hExternal events like hotplug or changes to "cpuset.cpus" or "cpuset.cpus.exclusive" can cause a valid partition root to become invalid and vice versa. Note that a task cannot be moved to a cgroup with empty "cpuset.cpus.effective".h]hExternal events like hotplug or changes to “cpuset.cpus” or “cpuset.cpus.exclusive” can cause a valid partition root to become invalid and vice versa. Note that a task cannot be moved to a cgroup with empty “cpuset.cpus.effective”.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjqCubh)}(hA valid non-root parent partition may distribute out all its CPUs to its child local partitions when there is no task associated with it.h]hA valid non-root parent partition may distribute out all its CPUs to its child local partitions when there is no task associated with it.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjqCubh)}(hXgCare must be taken to change a valid partition root to "member" as all its child local partitions, if present, will become invalid causing disruption to tasks running in those child partitions. These inactivated partitions could be recovered if their parent is switched back to a partition root with a proper value in "cpuset.cpus" or "cpuset.cpus.exclusive".h]hXsCare must be taken to change a valid partition root to “member” as all its child local partitions, if present, will become invalid causing disruption to tasks running in those child partitions. These inactivated partitions could be recovered if their parent is switched back to a partition root with a proper value in “cpuset.cpus” or “cpuset.cpus.exclusive”.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjqCubh)}(hXtPoll and inotify events are triggered whenever the state of "cpuset.cpus.partition" changes. That includes changes caused by write to "cpuset.cpus.partition", cpu hotplug or other changes that modify the validity status of the partition. This will allow user space agents to monitor unexpected changes to "cpuset.cpus.partition" without the need to do continuous polling.h]hXPoll and inotify events are triggered whenever the state of “cpuset.cpus.partition” changes. That includes changes caused by write to “cpuset.cpus.partition”, cpu hotplug or other changes that modify the validity status of the partition. This will allow user space agents to monitor unexpected changes to “cpuset.cpus.partition” without the need to do continuous polling.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjqCubh)}(hA user can pre-configure certain CPUs to an isolated state with load balancing disabled at boot time with the "isolcpus" kernel boot command line option. If those CPUs are to be put into a partition, they have to be used in an isolated partition.h]hA user can pre-configure certain CPUs to an isolated state with load balancing disabled at boot time with the “isolcpus” kernel boot command line option. If those CPUs are to be put into a partition, they have to be used in an isolated partition.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjqCubeh}(h]h ]h"]h$]h&]uh1jhj_Cubeh}(h]h ]h"]h$]h&]uh1jhhhM hj@ubeh}(h]h ]h"]h$]h&]uh1jhj@ubah}(h]h ]h"]h$]h&]uh1jhhhM" hj@hhubeh}(h]cpuset-interface-filesah ]h"]cpuset interface filesah$]h&]uh1hhjs@hhhhhM ubeh}(h]cpusetah ]h"]cpusetah$]h&]uh1hhjhhhhhM ubh)}(hhh](h)}(hDevice controllerh]hDevice controller}(hj,GhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj)GhhhhhM" ubh)}(hDevice controller manages access to device files. It includes both creation of new device files (using mknod), and access to the existing device files.h]hDevice controller manages access to device files. It includes both creation of new device files (using mknod), and access to the existing device files.}(hj:GhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM$ hj)Ghhubh)}(hXCgroup v2 device controller has no interface files and is implemented on top of cgroup BPF. To control access to device files, a user may create bpf programs of type BPF_PROG_TYPE_CGROUP_DEVICE and attach them to cgroups with BPF_CGROUP_DEVICE flag. On an attempt to access a device file, corresponding BPF programs will be executed, and depending on the return value the attempt will succeed or fail with -EPERM.h]hXCgroup v2 device controller has no interface files and is implemented on top of cgroup BPF. To control access to device files, a user may create bpf programs of type BPF_PROG_TYPE_CGROUP_DEVICE and attach them to cgroups with BPF_CGROUP_DEVICE flag. On an attempt to access a device file, corresponding BPF programs will be executed, and depending on the return value the attempt will succeed or fail with -EPERM.}(hjHGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM( hj)Ghhubh)}(hX A BPF_PROG_TYPE_CGROUP_DEVICE program takes a pointer to the bpf_cgroup_dev_ctx structure, which describes the device access attempt: access type (mknod/read/write) and device (type, major and minor numbers). If the program returns 0, the attempt fails with -EPERM, otherwise it succeeds.h]hX A BPF_PROG_TYPE_CGROUP_DEVICE program takes a pointer to the bpf_cgroup_dev_ctx structure, which describes the device access attempt: access type (mknod/read/write) and device (type, major and minor numbers). If the program returns 0, the attempt fails with -EPERM, otherwise it succeeds.}(hjVGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM/ hj)Ghhubh)}(hAn example of BPF_PROG_TYPE_CGROUP_DEVICE program may be found in tools/testing/selftests/bpf/progs/dev_cgroup.c in the kernel source tree.h]hAn example of BPF_PROG_TYPE_CGROUP_DEVICE program may be found in tools/testing/selftests/bpf/progs/dev_cgroup.c in the kernel source tree.}(hjdGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM5 hj)Ghhubeh}(h]device-controllerah ]h"]device controllerah$]h&]uh1hhjhhhhhM" ubh)}(hhh](h)}(hRDMAh]hRDMA}(hj}GhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjzGhhhhhM: ubh)}(hRThe "rdma" controller regulates the distribution and accounting of RDMA resources.h]hVThe “rdma” controller regulates the distribution and accounting of RDMA resources.}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM< hjzGhhubh)}(hhh](h)}(hRDMA Interface Filesh]hRDMA Interface Files}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGhhhhhM@ ubj)}(hXrdma.max A readwrite nested-keyed file that exists for all the cgroups except root that describes current configured resource limit for a RDMA/IB device. Lines are keyed by device name and are not ordered. Each line contains space separated resource name and its configured limit that can be distributed. The following nested keys are defined. ========== ============================= hca_handle Maximum number of HCA Handles hca_object Maximum number of HCA Objects ========== ============================= An example for mlx4 and ocrdma device follows:: mlx4_0 hca_handle=2 hca_object=2000 ocrdma1 hca_handle=3 hca_object=max rdma.current A read-only file that describes current resource usage. It exists for all the cgroup except root. An example for mlx4 and ocrdma device follows:: mlx4_0 hca_handle=1 hca_object=20 ocrdma1 hca_handle=1 hca_object=23 h]j)}(hhh](j)}(hXrdma.max A readwrite nested-keyed file that exists for all the cgroups except root that describes current configured resource limit for a RDMA/IB device. Lines are keyed by device name and are not ordered. Each line contains space separated resource name and its configured limit that can be distributed. The following nested keys are defined. ========== ============================= hca_handle Maximum number of HCA Handles hca_object Maximum number of HCA Objects ========== ============================= An example for mlx4 and ocrdma device follows:: mlx4_0 hca_handle=2 hca_object=2000 ocrdma1 hca_handle=3 hca_object=max h](j)}(hrdma.maxh]hrdma.max}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMU hjGubj)}(hhh](h)}(hA readwrite nested-keyed file that exists for all the cgroups except root that describes current configured resource limit for a RDMA/IB device.h]hA readwrite nested-keyed file that exists for all the cgroups except root that describes current configured resource limit for a RDMA/IB device.}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMC hjGubh)}(hLines are keyed by device name and are not ordered. Each line contains space separated resource name and its configured limit that can be distributed.h]hLines are keyed by device name and are not ordered. Each line contains space separated resource name and its configured limit that can be distributed.}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMG hjGubh)}(h&The following nested keys are defined.h]h&The following nested keys are defined.}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMK hjGubj)}(h========== ============================= hca_handle Maximum number of HCA Handles hca_object Maximum number of HCA Objects ========== ============================= h]j)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jhjGubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjGubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h hca_handleh]h hca_handle}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMN hjHubah}(h]h ]h"]h$]h&]uh1jhjHubj)}(hhh]h)}(hMaximum number of HCA Handlesh]hMaximum number of HCA Handles}(hj.HhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMN hj+Hubah}(h]h ]h"]h$]h&]uh1jhjHubeh}(h]h ]h"]h$]h&]uh1jhjHubj)}(hhh](j)}(hhh]h)}(h hca_objecth]h hca_object}(hjNHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMO hjKHubah}(h]h ]h"]h$]h&]uh1jhjHHubj)}(hhh]h)}(hMaximum number of HCA Objectsh]hMaximum number of HCA Objects}(hjeHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMO hjbHubah}(h]h ]h"]h$]h&]uh1jhjHHubeh}(h]h ]h"]h$]h&]uh1jhjHubeh}(h]h ]h"]h$]h&]uh1jhjGubeh}(h]h ]h"]h$]h&]colsKuh1jhjGubah}(h]h ]h"]h$]h&]uh1jhjGubah}(h]h ]h"]h$]h&]uh1jhhhMM hjGubh)}(h/An example for mlx4 and ocrdma device follows::h]h.An example for mlx4 and ocrdma device follows:}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMR hjGubjV)}(hGmlx4_0 hca_handle=2 hca_object=2000 ocrdma1 hca_handle=3 hca_object=maxh]hGmlx4_0 hca_handle=2 hca_object=2000 ocrdma1 hca_handle=3 hca_object=max}hjHsbah}(h]h ]h"]h$]h&]jjuh1jUhhhMT hjGubeh}(h]h ]h"]h$]h&]uh1jhjGubeh}(h]h ]h"]h$]h&]uh1jhhhMU hjGubj)}(hrdma.current A read-only file that describes current resource usage. It exists for all the cgroup except root. An example for mlx4 and ocrdma device follows:: mlx4_0 hca_handle=1 hca_object=20 ocrdma1 hca_handle=1 hca_object=23 h](j)}(h rdma.currenth]h rdma.current}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM^ hjHubj)}(hhh](h)}(haA read-only file that describes current resource usage. It exists for all the cgroup except root.h]haA read-only file that describes current resource usage. It exists for all the cgroup except root.}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMX hjHubh)}(h/An example for mlx4 and ocrdma device follows::h]h.An example for mlx4 and ocrdma device follows:}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM[ hjHubjV)}(hDmlx4_0 hca_handle=1 hca_object=20 ocrdma1 hca_handle=1 hca_object=23h]hDmlx4_0 hca_handle=1 hca_object=20 ocrdma1 hca_handle=1 hca_object=23}hjHsbah}(h]h ]h"]h$]h&]jjuh1jUhhhM] hjHubeh}(h]h ]h"]h$]h&]uh1jhjHubeh}(h]h ]h"]h$]h&]uh1jhhhM^ hjGubeh}(h]h ]h"]h$]h&]uh1jhjGubah}(h]h ]h"]h$]h&]uh1jhhhMB hjGhhubeh}(h]rdma-interface-filesah ]h"]rdma interface filesah$]h&]uh1hhjzGhhhhhM@ ubeh}(h]rdmaah ]h"]rdmaah$]h&]uh1hhjhhhhhM: ubh)}(hhh](h)}(hDMEMh]hDMEM}(hj*IhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj'IhhhhhMa ubh)}(hThe "dmem" controller regulates the distribution and accounting of device memory regions. Because each memory region may have its own page size, which does not have to be equal to the system page size, the units are always bytes.h]hThe “dmem” controller regulates the distribution and accounting of device memory regions. Because each memory region may have its own page size, which does not have to be equal to the system page size, the units are always bytes.}(hj8IhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMc hj'Ihhubh)}(hhh](h)}(hDMEM Interface Filesh]hDMEM Interface Files}(hjIIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjFIhhhhhMh ubj)}(hXdmem.max, dmem.min, dmem.low A readwrite nested-keyed file that exists for all the cgroups except root that describes current configured resource limit for a region. An example for xe follows:: drm/0000:03:00.0/vram0 1073741824 drm/0000:03:00.0/stolen max The semantics are the same as for the memory cgroup controller, and are calculated in the same way. dmem.capacity A read-only file that describes maximum region capacity. It only exists on the root cgroup. Not all memory can be allocated by cgroups, as the kernel reserves some for internal use. An example for xe follows:: drm/0000:03:00.0/vram0 8514437120 drm/0000:03:00.0/stolen 67108864 dmem.current A read-only file that describes current resource usage. It exists for all the cgroup except root. An example for xe follows:: drm/0000:03:00.0/vram0 12550144 drm/0000:03:00.0/stolen 8650752 h]j)}(hhh](j)}(hXkdmem.max, dmem.min, dmem.low A readwrite nested-keyed file that exists for all the cgroups except root that describes current configured resource limit for a region. An example for xe follows:: drm/0000:03:00.0/vram0 1073741824 drm/0000:03:00.0/stolen max The semantics are the same as for the memory cgroup controller, and are calculated in the same way. h](j)}(hdmem.max, dmem.min, dmem.lowh]hdmem.max, dmem.min, dmem.low}(hjbIhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMu hj^Iubj)}(hhh](h)}(hA readwrite nested-keyed file that exists for all the cgroups except root that describes current configured resource limit for a region.h]hA readwrite nested-keyed file that exists for all the cgroups except root that describes current configured resource limit for a region.}(hjsIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMk hjpIubh)}(hAn example for xe follows::h]hAn example for xe follows:}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMo hjpIubjV)}(h=drm/0000:03:00.0/vram0 1073741824 drm/0000:03:00.0/stolen maxh]h=drm/0000:03:00.0/vram0 1073741824 drm/0000:03:00.0/stolen max}hjIsbah}(h]h ]h"]h$]h&]jjuh1jUhhhMq hjpIubh)}(hcThe semantics are the same as for the memory cgroup controller, and are calculated in the same way.h]hcThe semantics are the same as for the memory cgroup controller, and are calculated in the same way.}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMt hjpIubeh}(h]h ]h"]h$]h&]uh1jhj^Iubeh}(h]h ]h"]h$]h&]uh1jhhhMu hj[Iubj)}(hX)dmem.capacity A read-only file that describes maximum region capacity. It only exists on the root cgroup. Not all memory can be allocated by cgroups, as the kernel reserves some for internal use. An example for xe follows:: drm/0000:03:00.0/vram0 8514437120 drm/0000:03:00.0/stolen 67108864 h](j)}(h dmem.capacityh]h dmem.capacity}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjIubj)}(hhh](h)}(hA read-only file that describes maximum region capacity. It only exists on the root cgroup. Not all memory can be allocated by cgroups, as the kernel reserves some for internal use.h]hA read-only file that describes maximum region capacity. It only exists on the root cgroup. Not all memory can be allocated by cgroups, as the kernel reserves some for internal use.}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMx hjIubh)}(hAn example for xe follows::h]hAn example for xe follows:}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM} hjIubjV)}(hBdrm/0000:03:00.0/vram0 8514437120 drm/0000:03:00.0/stolen 67108864h]hBdrm/0000:03:00.0/vram0 8514437120 drm/0000:03:00.0/stolen 67108864}hjIsbah}(h]h ]h"]h$]h&]jjuh1jUhhhM hjIubeh}(h]h ]h"]h$]h&]uh1jhjIubeh}(h]h ]h"]h$]h&]uh1jhhhM hj[Iubj)}(hdmem.current A read-only file that describes current resource usage. It exists for all the cgroup except root. An example for xe follows:: drm/0000:03:00.0/vram0 12550144 drm/0000:03:00.0/stolen 8650752 h](j)}(h dmem.currenth]h dmem.current}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjJubj)}(hhh](h)}(haA read-only file that describes current resource usage. It exists for all the cgroup except root.h]haA read-only file that describes current resource usage. It exists for all the cgroup except root.}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjJubh)}(hAn example for xe follows::h]hAn example for xe follows:}(hj%JhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjJubjV)}(h?drm/0000:03:00.0/vram0 12550144 drm/0000:03:00.0/stolen 8650752h]h?drm/0000:03:00.0/vram0 12550144 drm/0000:03:00.0/stolen 8650752}hj3Jsbah}(h]h ]h"]h$]h&]jjuh1jUhhhM hjJubeh}(h]h ]h"]h$]h&]uh1jhjJubeh}(h]h ]h"]h$]h&]uh1jhhhM hj[Iubeh}(h]h ]h"]h$]h&]uh1jhjWIubah}(h]h ]h"]h$]h&]uh1jhhhMj hjFIhhubeh}(h]dmem-interface-filesah ]h"]dmem interface filesah$]h&]uh1hhj'IhhhhhMh ubeh}(h]dmemah ]h"]dmemah$]h&]uh1hhjhhhhhMa ubh)}(hhh](h)}(hHugeTLBh]hHugeTLB}(hjlJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjiJhhhhhM ubh)}(hThe HugeTLB controller allows to limit the HugeTLB usage per control group and enforces the controller limit during page fault.h]hThe HugeTLB controller allows to limit the HugeTLB usage per control group and enforces the controller limit during page fault.}(hjzJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjiJhhubh)}(hhh](h)}(hHugeTLB Interface Filesh]hHugeTLB Interface Files}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjJhhhhhM ubj)}(hXhugetlb..current Show current usage for "hugepagesize" hugetlb. It exists for all the cgroup except root. hugetlb..max Set/show the hard limit of "hugepagesize" hugetlb usage. The default value is "max". It exists for all the cgroup except root. hugetlb..events A read-only flat-keyed file which exists on non-root cgroups. max The number of allocation failure due to HugeTLB limit hugetlb..events.local Similar to hugetlb..events but the fields in the file are local to the cgroup i.e. not hierarchical. The file modified event generated on this file reflects only the local events. hugetlb..numa_stat Similar to memory.numa_stat, it shows the numa information of the hugetlb pages of in this cgroup. Only active in use hugetlb pages are included. The per-node values are in bytes. h]j)}(hhh](j)}(hyhugetlb..current Show current usage for "hugepagesize" hugetlb. It exists for all the cgroup except root. h](j)}(hhugetlb..currenth]hhugetlb..current}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjJubj)}(hhh]h)}(hYShow current usage for "hugepagesize" hugetlb. It exists for all the cgroup except root.h]h]Show current usage for “hugepagesize” hugetlb. It exists for all the cgroup except root.}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjJubah}(h]h ]h"]h$]h&]uh1jhjJubeh}(h]h ]h"]h$]h&]uh1jhhhM hjJubj)}(hhugetlb..max Set/show the hard limit of "hugepagesize" hugetlb usage. The default value is "max". It exists for all the cgroup except root. h](j)}(hhugetlb..maxh]hhugetlb..max}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjJubj)}(hhh]h)}(hSet/show the hard limit of "hugepagesize" hugetlb usage. The default value is "max". It exists for all the cgroup except root.h]hSet/show the hard limit of “hugepagesize” hugetlb usage. The default value is “max”. It exists for all the cgroup except root.}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjJubah}(h]h ]h"]h$]h&]uh1jhjJubeh}(h]h ]h"]h$]h&]uh1jhhhM hjJubj)}(hhugetlb..events A read-only flat-keyed file which exists on non-root cgroups. max The number of allocation failure due to HugeTLB limit h](j)}(hhugetlb..eventsh]hhugetlb..events}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjJubj)}(hhh](h)}(h=A read-only flat-keyed file which exists on non-root cgroups.h]h=A read-only flat-keyed file which exists on non-root cgroups.}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjKubj)}(h@max The number of allocation failure due to HugeTLB limit h]j)}(hhh]j)}(h:max The number of allocation failure due to HugeTLB limit h](j)}(hmaxh]hmax}(hj,KhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hj(Kubj)}(hhh]h)}(h5The number of allocation failure due to HugeTLB limith]h5The number of allocation failure due to HugeTLB limit}(hj=KhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj:Kubah}(h]h ]h"]h$]h&]uh1jhj(Kubeh}(h]h ]h"]h$]h&]uh1jhhhM hj%Kubah}(h]h ]h"]h$]h&]uh1jhj!Kubah}(h]h ]h"]h$]h&]uh1jhhhM hjKubeh}(h]h ]h"]h$]h&]uh1jhjJubeh}(h]h ]h"]h$]h&]uh1jhhhM hjJubj)}(hhugetlb..events.local Similar to hugetlb..events but the fields in the file are local to the cgroup i.e. not hierarchical. The file modified event generated on this file reflects only the local events. h](j)}(h#hugetlb..events.localh]h#hugetlb..events.local}(hjsKhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjoKubj)}(hhh]h)}(hSimilar to hugetlb..events but the fields in the file are local to the cgroup i.e. not hierarchical. The file modified event generated on this file reflects only the local events.h]hSimilar to hugetlb..events but the fields in the file are local to the cgroup i.e. not hierarchical. The file modified event generated on this file reflects only the local events.}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjKubah}(h]h ]h"]h$]h&]uh1jhjoKubeh}(h]h ]h"]h$]h&]uh1jhhhM hjJubj)}(hhugetlb..numa_stat Similar to memory.numa_stat, it shows the numa information of the hugetlb pages of in this cgroup. Only active in use hugetlb pages are included. The per-node values are in bytes. h](j)}(h hugetlb..numa_stath]h hugetlb..numa_stat}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjKubj)}(hhh]h)}(hSimilar to memory.numa_stat, it shows the numa information of the hugetlb pages of in this cgroup. Only active in use hugetlb pages are included. The per-node values are in bytes.h]hSimilar to memory.numa_stat, it shows the numa information of the hugetlb pages of in this cgroup. Only active in use hugetlb pages are included. The per-node values are in bytes.}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjKubah}(h]h ]h"]h$]h&]uh1jhjKubeh}(h]h ]h"]h$]h&]uh1jhhhM hjJubeh}(h]h ]h"]h$]h&]uh1jhjJubah}(h]h ]h"]h$]h&]uh1jhhhM hjJhhubeh}(h]hugetlb-interface-filesah ]h"]hugetlb interface filesah$]h&]uh1hhjiJhhhhhM ubeh}(h]hugetlbah ]h"]hugetlbah$]h&]uh1hhjhhhhhM ubh)}(hhh](h)}(hMisch]hMisc}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKhhhhhM ubh)}(hThe Miscellaneous cgroup provides the resource limiting and tracking mechanism for the scalar resources which cannot be abstracted like the other cgroup resources. Controller is enabled by the CONFIG_CGROUP_MISC config option.h]hThe Miscellaneous cgroup provides the resource limiting and tracking mechanism for the scalar resources which cannot be abstracted like the other cgroup resources. Controller is enabled by the CONFIG_CGROUP_MISC config option.}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjKhhubh)}(hX)A resource can be added to the controller via enum misc_res_type{} in the include/linux/misc_cgroup.h file and the corresponding name via misc_res_name[] in the kernel/cgroup/misc.c file. Provider of the resource must set its capacity prior to using the resource by calling misc_cg_set_capacity().h]hX)A resource can be added to the controller via enum misc_res_type{} in the include/linux/misc_cgroup.h file and the corresponding name via misc_res_name[] in the kernel/cgroup/misc.c file. Provider of the resource must set its capacity prior to using the resource by calling misc_cg_set_capacity().}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjKhhubh)}(hOnce a capacity is set then the resource usage can be updated using charge and uncharge APIs. All of the APIs to interact with misc controller are in include/linux/misc_cgroup.h.h]hOnce a capacity is set then the resource usage can be updated using charge and uncharge APIs. All of the APIs to interact with misc controller are in include/linux/misc_cgroup.h.}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjKhhubh)}(hhh](h)}(hMisc Interface Filesh]hMisc Interface Files}(hj'LhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj$LhhhhhM ubh)}(hqMiscellaneous controller provides 3 interface files. If two misc resources (res_a and res_b) are registered then:h]hqMiscellaneous controller provides 3 interface files. If two misc resources (res_a and res_b) are registered then:}(hj5LhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj$Lhhubj)}(hXmisc.capacity A read-only flat-keyed file shown only in the root cgroup. It shows miscellaneous scalar resources available on the platform along with their quantities:: $ cat misc.capacity res_a 50 res_b 10 misc.current A read-only flat-keyed file shown in the all cgroups. It shows the current usage of the resources in the cgroup and its children.:: $ cat misc.current res_a 3 res_b 0 misc.peak A read-only flat-keyed file shown in all cgroups. It shows the historical maximum usage of the resources in the cgroup and its children.:: $ cat misc.peak res_a 10 res_b 8 misc.max A read-write flat-keyed file shown in the non root cgroups. Allowed maximum usage of the resources in the cgroup and its children.:: $ cat misc.max res_a max res_b 4 Limit can be set by:: # echo res_a 1 > misc.max Limit can be set to max by:: # echo res_a max > misc.max Limits can be set higher than the capacity value in the misc.capacity file. misc.events A read-only flat-keyed file which exists on non-root cgroups. The following entries are defined. Unless specified otherwise, a value change in this file generates a file modified event. All fields in this file are hierarchical. max The number of times the cgroup's resource usage was about to go over the max boundary. misc.events.local Similar to misc.events but the fields in the file are local to the cgroup i.e. not hierarchical. The file modified event generated on this file reflects only the local events. h]j)}(hhh](j)}(hmisc.capacity A read-only flat-keyed file shown only in the root cgroup. It shows miscellaneous scalar resources available on the platform along with their quantities:: $ cat misc.capacity res_a 50 res_b 10 h](j)}(h misc.capacityh]h misc.capacity}(hjNLhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjJLubj)}(hhh](h)}(hA read-only flat-keyed file shown only in the root cgroup. It shows miscellaneous scalar resources available on the platform along with their quantities::h]hA read-only flat-keyed file shown only in the root cgroup. It shows miscellaneous scalar resources available on the platform along with their quantities:}(hj_LhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj\LubjV)}(h%$ cat misc.capacity res_a 50 res_b 10h]h%$ cat misc.capacity res_a 50 res_b 10}hjmLsbah}(h]h ]h"]h$]h&]jjuh1jUhhhM hj\Lubeh}(h]h ]h"]h$]h&]uh1jhjJLubeh}(h]h ]h"]h$]h&]uh1jhhhM hjGLubj)}(hmisc.current A read-only flat-keyed file shown in the all cgroups. It shows the current usage of the resources in the cgroup and its children.:: $ cat misc.current res_a 3 res_b 0 h](j)}(h misc.currenth]h misc.current}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjLubj)}(hhh](h)}(hA read-only flat-keyed file shown in the all cgroups. It shows the current usage of the resources in the cgroup and its children.::h]hA read-only flat-keyed file shown in the all cgroups. It shows the current usage of the resources in the cgroup and its children.:}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjLubjV)}(h"$ cat misc.current res_a 3 res_b 0h]h"$ cat misc.current res_a 3 res_b 0}hjLsbah}(h]h ]h"]h$]h&]jjuh1jUhhhM hjLubeh}(h]h ]h"]h$]h&]uh1jhjLubeh}(h]h ]h"]h$]h&]uh1jhhhM hjGLubj)}(hmisc.peak A read-only flat-keyed file shown in all cgroups. It shows the historical maximum usage of the resources in the cgroup and its children.:: $ cat misc.peak res_a 10 res_b 8 h](j)}(h misc.peakh]h misc.peak}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjLubj)}(hhh](h)}(hA read-only flat-keyed file shown in all cgroups. It shows the historical maximum usage of the resources in the cgroup and its children.::h]hA read-only flat-keyed file shown in all cgroups. It shows the historical maximum usage of the resources in the cgroup and its children.:}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjLubjV)}(h $ cat misc.peak res_a 10 res_b 8h]h $ cat misc.peak res_a 10 res_b 8}hjLsbah}(h]h ]h"]h$]h&]jjuh1jUhhhM hjLubeh}(h]h ]h"]h$]h&]uh1jhjLubeh}(h]h ]h"]h$]h&]uh1jhhhM hjGLubj)}(hXtmisc.max A read-write flat-keyed file shown in the non root cgroups. Allowed maximum usage of the resources in the cgroup and its children.:: $ cat misc.max res_a max res_b 4 Limit can be set by:: # echo res_a 1 > misc.max Limit can be set to max by:: # echo res_a max > misc.max Limits can be set higher than the capacity value in the misc.capacity file. h](j)}(hmisc.maxh]hmisc.max}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjMubj)}(hhh](h)}(hA read-write flat-keyed file shown in the non root cgroups. Allowed maximum usage of the resources in the cgroup and its children.::h]hA read-write flat-keyed file shown in the non root cgroups. Allowed maximum usage of the resources in the cgroup and its children.:}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjMubjV)}(h $ cat misc.max res_a max res_b 4h]h $ cat misc.max res_a max res_b 4}hj$Msbah}(h]h ]h"]h$]h&]jjuh1jUhhhM hjMubh)}(hLimit can be set by::h]hLimit can be set by:}(hj2MhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjMubjV)}(h# echo res_a 1 > misc.maxh]h# echo res_a 1 > misc.max}hj@Msbah}(h]h ]h"]h$]h&]jjuh1jUhhhM hjMubh)}(hLimit can be set to max by::h]hLimit can be set to max by:}(hjNMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjMubjV)}(h# echo res_a max > misc.maxh]h# echo res_a max > misc.max}hj\Msbah}(h]h ]h"]h$]h&]jjuh1jUhhhM hjMubh)}(hKLimits can be set higher than the capacity value in the misc.capacity file.h]hKLimits can be set higher than the capacity value in the misc.capacity file.}(hjjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjMubeh}(h]h ]h"]h$]h&]uh1jhjMubeh}(h]h ]h"]h$]h&]uh1jhhhM hjGLubj)}(hX^misc.events A read-only flat-keyed file which exists on non-root cgroups. The following entries are defined. Unless specified otherwise, a value change in this file generates a file modified event. All fields in this file are hierarchical. max The number of times the cgroup's resource usage was about to go over the max boundary. h](j)}(h misc.eventsh]h misc.events}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjMubj)}(hhh](h)}(hA read-only flat-keyed file which exists on non-root cgroups. The following entries are defined. Unless specified otherwise, a value change in this file generates a file modified event. All fields in this file are hierarchical.h]hA read-only flat-keyed file which exists on non-root cgroups. The following entries are defined. Unless specified otherwise, a value change in this file generates a file modified event. All fields in this file are hierarchical.}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjMubj)}(hgmax The number of times the cgroup's resource usage was about to go over the max boundary. h]j)}(hhh]j)}(h[max The number of times the cgroup's resource usage was about to go over the max boundary. h](j)}(hmaxh]hmax}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjMubj)}(hhh]h)}(hVThe number of times the cgroup's resource usage was about to go over the max boundary.h]hXThe number of times the cgroup’s resource usage was about to go over the max boundary.}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjMubah}(h]h ]h"]h$]h&]uh1jhjMubeh}(h]h ]h"]h$]h&]uh1jhhhM hjMubah}(h]h ]h"]h$]h&]uh1jhjMubah}(h]h ]h"]h$]h&]uh1jhhhM hjMubeh}(h]h ]h"]h$]h&]uh1jhjMubeh}(h]h ]h"]h$]h&]uh1jhhhM hjGLubj)}(hmisc.events.local Similar to misc.events but the fields in the file are local to the cgroup i.e. not hierarchical. The file modified event generated on this file reflects only the local events. h](j)}(hmisc.events.localh]hmisc.events.local}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjMubj)}(hhh]h)}(hSimilar to misc.events but the fields in the file are local to the cgroup i.e. not hierarchical. The file modified event generated on this file reflects only the local events.h]hSimilar to misc.events but the fields in the file are local to the cgroup i.e. not hierarchical. The file modified event generated on this file reflects only the local events.}(hj NhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjNubah}(h]h ]h"]h$]h&]uh1jhjMubeh}(h]h ]h"]h$]h&]uh1jhhhM hjGLubeh}(h]h ]h"]h$]h&]uh1jhjCLubah}(h]h ]h"]h$]h&]uh1jhhhM hj$Lhhubeh}(h]misc-interface-filesah ]h"]misc interface filesah$]h&]uh1hhjKhhhhhM ubh)}(hhh](h)}(hMigration and Ownershiph]hMigration and Ownership}(hj;NhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8NhhhhhM ubh)}(hX A miscellaneous scalar resource is charged to the cgroup in which it is used first, and stays charged to that cgroup until that resource is freed. Migrating a process to a different cgroup does not move the charge to the destination cgroup where the process has moved.h]hX A miscellaneous scalar resource is charged to the cgroup in which it is used first, and stays charged to that cgroup until that resource is freed. Migrating a process to a different cgroup does not move the charge to the destination cgroup where the process has moved.}(hjINhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj8Nhhubeh}(h]migration-and-ownershipah ]h"]migration and ownershipah$]h&]uh1hhjKhhhhhM ubeh}(h]miscah ]h"]miscah$]h&]uh1hhjhhhhhM ubh)}(hhh](h)}(hOthersh]hOthers}(hjjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjgNhhhhhM ubh)}(hhh](h)}(h perf_eventh]h perf_event}(hj{NhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjxNhhhhhM ubh)}(hXperf_event controller, if not mounted on a legacy hierarchy, is automatically enabled on the v2 hierarchy so that perf events can always be filtered by cgroup v2 path. The controller can still be moved to a legacy hierarchy after v2 hierarchy is populated.h]hXperf_event controller, if not mounted on a legacy hierarchy, is automatically enabled on the v2 hierarchy so that perf events can always be filtered by cgroup v2 path. The controller can still be moved to a legacy hierarchy after v2 hierarchy is populated.}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjxNhhubeh}(h] perf-eventah ]h"] perf_eventah$]h&]uh1hhjgNhhhhhM ubeh}(h]othersah ]h"]othersah$]h&]uh1hhjhhhhhM ubh)}(hhh](h)}(hNon-normative informationh]hNon-normative information}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjNhhhhhM ubh)}(hzThis section contains information that isn't considered to be a part of the stable kernel API and so is subject to change.h]h|This section contains information that isn’t considered to be a part of the stable kernel API and so is subject to change.}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjNhhubh)}(hhh](h)}(h,CPU controller root cgroup process behaviourh]h,CPU controller root cgroup process behaviour}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjNhhhhhM ubh)}(hWhen distributing CPU cycles in the root cgroup each thread in this cgroup is treated as if it was hosted in a separate child cgroup of the root cgroup. This child cgroup weight is dependent on its thread nice level.h]hWhen distributing CPU cycles in the root cgroup each thread in this cgroup is treated as if it was hosted in a separate child cgroup of the root cgroup. This child cgroup weight is dependent on its thread nice level.}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjNhhubh)}(hFor details of this mapping see sched_prio_to_weight array in kernel/sched/core.c file (values from this array should be scaled appropriately so the neutral - nice 0 - value is 100 instead of 1024).h]hFor details of this mapping see sched_prio_to_weight array in kernel/sched/core.c file (values from this array should be scaled appropriately so the neutral - nice 0 - value is 100 instead of 1024).}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM! hjNhhubeh}(h],cpu-controller-root-cgroup-process-behaviourah ]h"],cpu controller root cgroup process behaviourah$]h&]uh1hhjNhhhhhM ubh)}(hhh](h)}(h+IO controller root cgroup process behaviourh]h+IO controller root cgroup process behaviour}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjNhhhhhM' ubh)}(hRoot cgroup processes are hosted in an implicit leaf child node. When distributing IO resources this implicit child node is taken into account as if it was a normal child cgroup of the root cgroup with a weight value of 200.h]hRoot cgroup processes are hosted in an implicit leaf child node. When distributing IO resources this implicit child node is taken into account as if it was a normal child cgroup of the root cgroup with a weight value of 200.}(hj OhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM) hjNhhubeh}(h]+io-controller-root-cgroup-process-behaviourah ]h"]+io controller root cgroup process behaviourah$]h&]uh1hhjNhhhhhM' ubeh}(h]non-normative-informationah ]h"]non-normative informationah$]h&]uh1hhjhhhhhM ubeh}(h] controllersah ]h"] controllersah$]h&]uh1hhhhhhhhM$ubh)}(hhh](h)}(h Namespaceh]h Namespace}(hj5OhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj2OhhhhhM0 ubh)}(hhh](h)}(hBasicsh]hBasics}(hjFOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjCOhhhhhM3 ubh)}(hXcgroup namespace provides a mechanism to virtualize the view of the "/proc/$PID/cgroup" file and cgroup mounts. The CLONE_NEWCGROUP clone flag can be used with clone(2) and unshare(2) to create a new cgroup namespace. The process running inside the cgroup namespace will have its "/proc/$PID/cgroup" output restricted to cgroupns root. The cgroupns root is the cgroup of the process at the time of creation of the cgroup namespace.h]hXcgroup namespace provides a mechanism to virtualize the view of the “/proc/$PID/cgroup” file and cgroup mounts. The CLONE_NEWCGROUP clone flag can be used with clone(2) and unshare(2) to create a new cgroup namespace. The process running inside the cgroup namespace will have its “/proc/$PID/cgroup” output restricted to cgroupns root. The cgroupns root is the cgroup of the process at the time of creation of the cgroup namespace.}(hjTOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM5 hjCOhhubh)}(hX;Without cgroup namespace, the "/proc/$PID/cgroup" file shows the complete path of the cgroup of a process. In a container setup where a set of cgroups and namespaces are intended to isolate processes the "/proc/$PID/cgroup" file may leak potential system level information to the isolated processes. For example::h]hXBWithout cgroup namespace, the “/proc/$PID/cgroup” file shows the complete path of the cgroup of a process. In a container setup where a set of cgroups and namespaces are intended to isolate processes the “/proc/$PID/cgroup” file may leak potential system level information to the isolated processes. For example:}(hjbOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM= hjCOhhubjV)}(h3# cat /proc/self/cgroup 0::/batchjobs/container_id1h]h3# cat /proc/self/cgroup 0::/batchjobs/container_id1}hjpOsbah}(h]h ]h"]h$]h&]jjuh1jUhhhMC hjCOhhubh)}(hThe path '/batchjobs/container_id1' can be considered as system-data and undesirable to expose to the isolated processes. cgroup namespace can be used to restrict visibility of this path. For example, before creating a cgroup namespace, one would see::h]hXThe path ‘/batchjobs/container_id1’ can be considered as system-data and undesirable to expose to the isolated processes. cgroup namespace can be used to restrict visibility of this path. For example, before creating a cgroup namespace, one would see:}(hj~OhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMF hjCOhhubjV)}(h# ls -l /proc/self/ns/cgroup lrwxrwxrwx 1 root root 0 2014-07-15 10:37 /proc/self/ns/cgroup -> cgroup:[4026531835] # cat /proc/self/cgroup 0::/batchjobs/container_id1h]h# ls -l /proc/self/ns/cgroup lrwxrwxrwx 1 root root 0 2014-07-15 10:37 /proc/self/ns/cgroup -> cgroup:[4026531835] # cat /proc/self/cgroup 0::/batchjobs/container_id1}hjOsbah}(h]h ]h"]h$]h&]jjuh1jUhhhMK hjCOhhubh)}(h3After unsharing a new namespace, the view changes::h]h2After unsharing a new namespace, the view changes:}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMP hjCOhhubjV)}(h# ls -l /proc/self/ns/cgroup lrwxrwxrwx 1 root root 0 2014-07-15 10:35 /proc/self/ns/cgroup -> cgroup:[4026532183] # cat /proc/self/cgroup 0::/h]h# ls -l /proc/self/ns/cgroup lrwxrwxrwx 1 root root 0 2014-07-15 10:35 /proc/self/ns/cgroup -> cgroup:[4026532183] # cat /proc/self/cgroup 0::/}hjOsbah}(h]h ]h"]h$]h&]jjuh1jUhhhMR hjCOhhubh)}(hWhen some thread from a multi-threaded process unshares its cgroup namespace, the new cgroupns gets applied to the entire process (all the threads). This is natural for the v2 hierarchy; however, for the legacy hierarchies, this may be unexpected.h]hWhen some thread from a multi-threaded process unshares its cgroup namespace, the new cgroupns gets applied to the entire process (all the threads). This is natural for the v2 hierarchy; however, for the legacy hierarchies, this may be unexpected.}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMW hjCOhhubh)}(hA cgroup namespace is alive as long as there are processes inside or mounts pinning it. When the last usage goes away, the cgroup namespace is destroyed. The cgroupns root and the actual cgroups remain.h]hA cgroup namespace is alive as long as there are processes inside or mounts pinning it. When the last usage goes away, the cgroup namespace is destroyed. The cgroupns root and the actual cgroups remain.}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM\ hjCOhhubeh}(h]basicsah ]h"]basicsah$]h&]uh1hhj2OhhhhhM3 ubh)}(hhh](h)}(hThe Root and Viewsh]hThe Root and Views}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjOhhhhhMc ubh)}(hX1The 'cgroupns root' for a cgroup namespace is the cgroup in which the process calling unshare(2) is running. For example, if a process in /batchjobs/container_id1 cgroup calls unshare, cgroup /batchjobs/container_id1 becomes the cgroupns root. For the init_cgroup_ns, this is the real root ('/') cgroup.h]hX9The ‘cgroupns root’ for a cgroup namespace is the cgroup in which the process calling unshare(2) is running. For example, if a process in /batchjobs/container_id1 cgroup calls unshare, cgroup /batchjobs/container_id1 becomes the cgroupns root. For the init_cgroup_ns, this is the real root (‘/’) cgroup.}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMe hjOhhubh)}(hrThe cgroupns root cgroup does not change even if the namespace creator process later moves to a different cgroup::h]hqThe cgroupns root cgroup does not change even if the namespace creator process later moves to a different cgroup:}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMk hjOhhubjV)}(h# ~/unshare -c # unshare cgroupns in some cgroup # cat /proc/self/cgroup 0::/ # mkdir sub_cgrp_1 # echo 0 > sub_cgrp_1/cgroup.procs # cat /proc/self/cgroup 0::/sub_cgrp_1h]h# ~/unshare -c # unshare cgroupns in some cgroup # cat /proc/self/cgroup 0::/ # mkdir sub_cgrp_1 # echo 0 > sub_cgrp_1/cgroup.procs # cat /proc/self/cgroup 0::/sub_cgrp_1}hjPsbah}(h]h ]h"]h$]h&]jjuh1jUhhhMn hjOhhubh)}(hDEach process gets its namespace-specific view of "/proc/$PID/cgroup"h]hHEach process gets its namespace-specific view of “/proc/$PID/cgroup”}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMv hjOhhubh)}(hProcesses running inside the cgroup namespace will be able to see cgroup paths (in /proc/self/cgroup) only inside their root cgroup. From within an unshared cgroupns::h]hProcesses running inside the cgroup namespace will be able to see cgroup paths (in /proc/self/cgroup) only inside their root cgroup. From within an unshared cgroupns:}(hj#PhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMx hjOhhubjV)}(hf# sleep 100000 & [1] 7353 # echo 7353 > sub_cgrp_1/cgroup.procs # cat /proc/7353/cgroup 0::/sub_cgrp_1h]hf# sleep 100000 & [1] 7353 # echo 7353 > sub_cgrp_1/cgroup.procs # cat /proc/7353/cgroup 0::/sub_cgrp_1}hj1Psbah}(h]h ]h"]h$]h&]jjuh1jUhhhM| hjOhhubh)}(hIFrom the initial cgroup namespace, the real cgroup path will be visible::h]hHFrom the initial cgroup namespace, the real cgroup path will be visible:}(hj?PhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjOhhubjV)}(h>$ cat /proc/7353/cgroup 0::/batchjobs/container_id1/sub_cgrp_1h]h>$ cat /proc/7353/cgroup 0::/batchjobs/container_id1/sub_cgrp_1}hjMPsbah}(h]h ]h"]h$]h&]jjuh1jUhhhM hjOhhubh)}(hXFrom a sibling cgroup namespace (that is, a namespace rooted at a different cgroup), the cgroup path relative to its own cgroup namespace root will be shown. For instance, if PID 7353's cgroup namespace root is at '/batchjobs/container_id2', then it will see::h]hX From a sibling cgroup namespace (that is, a namespace rooted at a different cgroup), the cgroup path relative to its own cgroup namespace root will be shown. For instance, if PID 7353’s cgroup namespace root is at ‘/batchjobs/container_id2’, then it will see:}(hj[PhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjOhhubjV)}(h7# cat /proc/7353/cgroup 0::/../container_id2/sub_cgrp_1h]h7# cat /proc/7353/cgroup 0::/../container_id2/sub_cgrp_1}hjiPsbah}(h]h ]h"]h$]h&]jjuh1jUhhhM hjOhhubh)}(h|Note that the relative path always starts with '/' to indicate that its relative to the cgroup namespace root of the caller.h]hNote that the relative path always starts with ‘/’ to indicate that its relative to the cgroup namespace root of the caller.}(hjwPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjOhhubeh}(h]the-root-and-viewsah ]h"]the root and viewsah$]h&]uh1hhj2OhhhhhMc ubh)}(hhh](h)}(hMigration and setns(2)h]hMigration and setns(2)}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjPhhhhhM ubh)}(hX"Processes inside a cgroup namespace can move into and out of the namespace root if they have proper access to external cgroups. For example, from inside a namespace with cgroupns root at /batchjobs/container_id1, and assuming that the global hierarchy is still accessible inside cgroupns::h]hX!Processes inside a cgroup namespace can move into and out of the namespace root if they have proper access to external cgroups. For example, from inside a namespace with cgroupns root at /batchjobs/container_id1, and assuming that the global hierarchy is still accessible inside cgroupns:}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjPhhubjV)}(h# cat /proc/7353/cgroup 0::/sub_cgrp_1 # echo 7353 > batchjobs/container_id2/cgroup.procs # cat /proc/7353/cgroup 0::/../container_id2h]h# cat /proc/7353/cgroup 0::/sub_cgrp_1 # echo 7353 > batchjobs/container_id2/cgroup.procs # cat /proc/7353/cgroup 0::/../container_id2}hjPsbah}(h]h ]h"]h$]h&]jjuh1jUhhhM hjPhhubh)}(hNote that this kind of setup is not encouraged. A task inside cgroup namespace should only be exposed to its own cgroupns hierarchy.h]hNote that this kind of setup is not encouraged. A task inside cgroup namespace should only be exposed to its own cgroupns hierarchy.}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjPhhubh)}(h5setns(2) to another cgroup namespace is allowed when:h]h5setns(2) to another cgroup namespace is allowed when:}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjPhhubjWF)}(hhh](j)}(h@the process has CAP_SYS_ADMIN against its current user namespaceh]h)}(hjPh]h@the process has CAP_SYS_ADMIN against its current user namespace}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjPubah}(h]h ]h"]h$]h&]uh1jhjPhhhhhNubj)}(hKthe process has CAP_SYS_ADMIN against the target cgroup namespace's userns h]h)}(hJthe process has CAP_SYS_ADMIN against the target cgroup namespace's usernsh]hLthe process has CAP_SYS_ADMIN against the target cgroup namespace’s userns}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjPubah}(h]h ]h"]h$]h&]uh1jhjPhhhhhNubeh}(h]h ]h"]h$]h&]jF loweralphajF(jFjFuh1jVFhjPhhhhhM ubh)}(hNo implicit cgroup changes happen with attaching to another cgroup namespace. It is expected that the someone moves the attaching process under the target cgroup namespace root.h]hNo implicit cgroup changes happen with attaching to another cgroup namespace. It is expected that the someone moves the attaching process under the target cgroup namespace root.}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjPhhubeh}(h]migration-and-setns-2ah ]h"]migration and setns(2)ah$]h&]uh1hhj2OhhhhhM ubh)}(hhh](h)}(h!Interaction with Other Namespacesh]h!Interaction with Other Namespaces}(hj)QhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj&QhhhhhM ubh)}(hlNamespace specific cgroup hierarchy can be mounted by a process running inside a non-init cgroup namespace::h]hkNamespace specific cgroup hierarchy can be mounted by a process running inside a non-init cgroup namespace:}(hj7QhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj&QhhubjV)}(h$# mount -t cgroup2 none $MOUNT_POINTh]h$# mount -t cgroup2 none $MOUNT_POINT}hjEQsbah}(h]h ]h"]h$]h&]jjuh1jUhhhM hj&Qhhubh)}(hThis will mount the unified cgroup hierarchy with cgroupns root as the filesystem root. The process needs CAP_SYS_ADMIN against its user and mount namespaces.h]hThis will mount the unified cgroup hierarchy with cgroupns root as the filesystem root. The process needs CAP_SYS_ADMIN against its user and mount namespaces.}(hjSQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj&Qhhubh)}(hThe virtualization of /proc/self/cgroup file combined with restricting the view of cgroup hierarchy by namespace-private cgroupfs mount provides a properly isolated cgroup view inside the container.h]hThe virtualization of /proc/self/cgroup file combined with restricting the view of cgroup hierarchy by namespace-private cgroupfs mount provides a properly isolated cgroup view inside the container.}(hjaQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj&Qhhubeh}(h]!interaction-with-other-namespacesah ]h"]!interaction with other namespacesah$]h&]uh1hhj2OhhhhhM ubeh}(h] namespaceah ]h"] namespaceah$]h&]uh1hhhhhhhhM0 ubh)}(hhh](h)}(h!Information on Kernel Programmingh]h!Information on Kernel Programming}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjQhhhhhM ubh)}(hThis section contains kernel programming information in the areas where interacting with cgroup is necessary. cgroup core and controllers are not covered.h]hThis section contains kernel programming information in the areas where interacting with cgroup is necessary. cgroup core and controllers are not covered.}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjQhhubh)}(hhh](h)}(h Filesystem Support for Writebackh]h Filesystem Support for Writeback}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjQhhhhhM ubh)}(hA filesystem can support cgroup writeback by updating address_space_operations->writepage[s]() to annotate bio's using the following two functions.h]hA filesystem can support cgroup writeback by updating address_space_operations->writepage[s]() to annotate bio’s using the following two functions.}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjQhhubj)}(hXWwbc_init_bio(@wbc, @bio) Should be called for each bio carrying writeback data and associates the bio with the inode's owner cgroup and the corresponding request queue. This must be called after a queue (device) has been associated with the bio and before submission. wbc_account_cgroup_owner(@wbc, @folio, @bytes) Should be called for each data segment being written out. While this function doesn't care exactly when it's called during the writeback session, it's the easiest and most natural to call it as data segments are added to a bio. h]j)}(hhh](j)}(hX wbc_init_bio(@wbc, @bio) Should be called for each bio carrying writeback data and associates the bio with the inode's owner cgroup and the corresponding request queue. This must be called after a queue (device) has been associated with the bio and before submission. h](j)}(hwbc_init_bio(@wbc, @bio)h]hwbc_init_bio(@wbc, @bio)}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjQubj)}(hhh]h)}(hShould be called for each bio carrying writeback data and associates the bio with the inode's owner cgroup and the corresponding request queue. This must be called after a queue (device) has been associated with the bio and before submission.h]hShould be called for each bio carrying writeback data and associates the bio with the inode’s owner cgroup and the corresponding request queue. This must be called after a queue (device) has been associated with the bio and before submission.}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjQubah}(h]h ]h"]h$]h&]uh1jhjQubeh}(h]h ]h"]h$]h&]uh1jhhhM hjQubj)}(hXwbc_account_cgroup_owner(@wbc, @folio, @bytes) Should be called for each data segment being written out. While this function doesn't care exactly when it's called during the writeback session, it's the easiest and most natural to call it as data segments are added to a bio. h](j)}(h.wbc_account_cgroup_owner(@wbc, @folio, @bytes)h]h.wbc_account_cgroup_owner(@wbc, @folio, @bytes)}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hjQubj)}(hhh]h)}(hShould be called for each data segment being written out. While this function doesn't care exactly when it's called during the writeback session, it's the easiest and most natural to call it as data segments are added to a bio.h]hShould be called for each data segment being written out. While this function doesn’t care exactly when it’s called during the writeback session, it’s the easiest and most natural to call it as data segments are added to a bio.}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjRubah}(h]h ]h"]h$]h&]uh1jhjQubeh}(h]h ]h"]h$]h&]uh1jhhhM hjQubeh}(h]h ]h"]h$]h&]uh1jhjQubah}(h]h ]h"]h$]h&]uh1jhhhM hjQhhubh)}(hXWith writeback bio's annotated, cgroup support can be enabled per super_block by setting SB_I_CGROUPWB in ->s_iflags. This allows for selective disabling of cgroup writeback support which is helpful when certain filesystem features, e.g. journaled data mode, are incompatible.h]hXWith writeback bio’s annotated, cgroup support can be enabled per super_block by setting SB_I_CGROUPWB in ->s_iflags. This allows for selective disabling of cgroup writeback support which is helpful when certain filesystem features, e.g. journaled data mode, are incompatible.}(hj.RhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjQhhubh)}(hXwbc_init_bio() binds the specified bio to its cgroup. Depending on the configuration, the bio may be executed at a lower priority and if the writeback session is holding shared resources, e.g. a journal entry, may lead to priority inversion. There is no one easy solution for the problem. Filesystems can try to work around specific problem cases by skipping wbc_init_bio() and using bio_associate_blkg() directly.h]hXwbc_init_bio() binds the specified bio to its cgroup. Depending on the configuration, the bio may be executed at a lower priority and if the writeback session is holding shared resources, e.g. a journal entry, may lead to priority inversion. There is no one easy solution for the problem. Filesystems can try to work around specific problem cases by skipping wbc_init_bio() and using bio_associate_blkg() directly.}(hjThe "tasks" file is removed and "cgroup.procs" is not sorted. h]h)}(h=The "tasks" file is removed and "cgroup.procs" is not sorted.h]hEThe “tasks” file is removed and “cgroup.procs” is not sorted.}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjRubah}(h]h ]h"]h$]h&]uh1jhjkRhhhhhNubj)}(h$"cgroup.clone_children" is removed. h]h)}(h#"cgroup.clone_children" is removed.h]h'“cgroup.clone_children” is removed.}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjRubah}(h]h ]h"]h$]h&]uh1jhjkRhhhhhNubj)}(hl/proc/cgroups is meaningless for v2. Use "cgroup.controllers" or "cgroup.stat" files at the root instead. h]h)}(hj/proc/cgroups is meaningless for v2. Use "cgroup.controllers" or "cgroup.stat" files at the root instead.h]hr/proc/cgroups is meaningless for v2. Use “cgroup.controllers” or “cgroup.stat” files at the root instead.}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjRubah}(h]h ]h"]h$]h&]uh1jhjkRhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhM hjZRhhubeh}(h]deprecated-v1-core-featuresah ]h"]deprecated v1 core featuresah$]h&]uh1hhhhhhhhM ubh)}(hhh](h)}(h$Issues with v1 and Rationales for v2h]h$Issues with v1 and Rationales for v2}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjRhhhhhM ubh)}(hhh](h)}(hMultiple Hierarchiesh]hMultiple Hierarchies}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhjShhhhhM ubh)}(hcgroup v1 allowed an arbitrary number of hierarchies and each hierarchy could host any number of controllers. While this seemed to provide a high level of flexibility, it wasn't useful in practice.h]hcgroup v1 allowed an arbitrary number of hierarchies and each hierarchy could host any number of controllers. While this seemed to provide a high level of flexibility, it wasn’t useful in practice.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjShhubh)}(hXFor example, as there is only one instance of each controller, utility type controllers such as freezer which can be useful in all hierarchies could only be used in one. The issue is exacerbated by the fact that controllers couldn't be moved to another hierarchy once hierarchies were populated. Another issue was that all controllers bound to a hierarchy were forced to have exactly the same view of the hierarchy. It wasn't possible to vary the granularity depending on the specific controller.h]hXFor example, as there is only one instance of each controller, utility type controllers such as freezer which can be useful in all hierarchies could only be used in one. The issue is exacerbated by the fact that controllers couldn’t be moved to another hierarchy once hierarchies were populated. Another issue was that all controllers bound to a hierarchy were forced to have exactly the same view of the hierarchy. It wasn’t possible to vary the granularity depending on the specific controller.}(hj$ShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjShhubh)}(hXIn practice, these issues heavily limited which controllers could be put on the same hierarchy and most configurations resorted to putting each controller on its own hierarchy. Only closely related ones, such as the cpu and cpuacct controllers, made sense to be put on the same hierarchy. This often meant that userland ended up managing multiple similar hierarchies repeating the same steps on each hierarchy whenever a hierarchy management operation was necessary.h]hXIn practice, these issues heavily limited which controllers could be put on the same hierarchy and most configurations resorted to putting each controller on its own hierarchy. Only closely related ones, such as the cpu and cpuacct controllers, made sense to be put on the same hierarchy. This often meant that userland ended up managing multiple similar hierarchies repeating the same steps on each hierarchy whenever a hierarchy management operation was necessary.}(hj2ShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjShhubh)}(hXFurthermore, support for multiple hierarchies came at a steep cost. It greatly complicated cgroup core implementation but more importantly the support for multiple hierarchies restricted how cgroup could be used in general and what controllers was able to do.h]hXFurthermore, support for multiple hierarchies came at a steep cost. It greatly complicated cgroup core implementation but more importantly the support for multiple hierarchies restricted how cgroup could be used in general and what controllers was able to do.}(hj@ShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjShhubh)}(hXThere was no limit on how many hierarchies there might be, which meant that a thread's cgroup membership couldn't be described in finite length. The key might contain any number of entries and was unlimited in length, which made it highly awkward to manipulate and led to addition of controllers which existed only to identify membership, which in turn exacerbated the original problem of proliferating number of hierarchies.h]hXThere was no limit on how many hierarchies there might be, which meant that a thread’s cgroup membership couldn’t be described in finite length. The key might contain any number of entries and was unlimited in length, which made it highly awkward to manipulate and led to addition of controllers which existed only to identify membership, which in turn exacerbated the original problem of proliferating number of hierarchies.}(hjNShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjShhubh)}(hXLAlso, as a controller couldn't have any expectation regarding the topologies of hierarchies other controllers might be on, each controller had to assume that all other controllers were attached to completely orthogonal hierarchies. This made it impossible, or at least very cumbersome, for controllers to cooperate with each other.h]hXNAlso, as a controller couldn’t have any expectation regarding the topologies of hierarchies other controllers might be on, each controller had to assume that all other controllers were attached to completely orthogonal hierarchies. This made it impossible, or at least very cumbersome, for controllers to cooperate with each other.}(hj\ShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM$ hjShhubh)}(hXIn most use cases, putting controllers on hierarchies which are completely orthogonal to each other isn't necessary. What usually is called for is the ability to have differing levels of granularity depending on the specific controller. In other words, hierarchy may be collapsed from leaf towards root when viewed from specific controllers. For example, a given configuration might not care about how memory is distributed beyond a certain level while still wanting to control how CPU cycles are distributed.h]hXIn most use cases, putting controllers on hierarchies which are completely orthogonal to each other isn’t necessary. What usually is called for is the ability to have differing levels of granularity depending on the specific controller. In other words, hierarchy may be collapsed from leaf towards root when viewed from specific controllers. For example, a given configuration might not care about how memory is distributed beyond a certain level while still wanting to control how CPU cycles are distributed.}(hjjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM* hjShhubeh}(h]multiple-hierarchiesah ]h"]multiple hierarchiesah$]h&]uh1hhjRhhhhhM ubh)}(hhh](h)}(hThread Granularityh]hThread Granularity}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhjShhhhhM5 ubh)}(hXEcgroup v1 allowed threads of a process to belong to different cgroups. This didn't make sense for some controllers and those controllers ended up implementing different ways to ignore such situations but much more importantly it blurred the line between API exposed to individual applications and system management interface.h]hXGcgroup v1 allowed threads of a process to belong to different cgroups. This didn’t make sense for some controllers and those controllers ended up implementing different ways to ignore such situations but much more importantly it blurred the line between API exposed to individual applications and system management interface.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM7 hjShhubh)}(hGenerally, in-process knowledge is available only to the process itself; thus, unlike service-level organization of processes, categorizing threads of a process requires active participation from the application which owns the target process.h]hGenerally, in-process knowledge is available only to the process itself; thus, unlike service-level organization of processes, categorizing threads of a process requires active participation from the application which owns the target process.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM= hjShhubh)}(hXjcgroup v1 had an ambiguously defined delegation model which got abused in combination with thread granularity. cgroups were delegated to individual applications so that they can create and manage their own sub-hierarchies and control resource distributions along them. This effectively raised cgroup to the status of a syscall-like API exposed to lay programs.h]hXjcgroup v1 had an ambiguously defined delegation model which got abused in combination with thread granularity. cgroups were delegated to individual applications so that they can create and manage their own sub-hierarchies and control resource distributions along them. This effectively raised cgroup to the status of a syscall-like API exposed to lay programs.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMB hjShhubh)}(hX)First of all, cgroup has a fundamentally inadequate interface to be exposed this way. For a process to access its own knobs, it has to extract the path on the target hierarchy from /proc/self/cgroup, construct the path by appending the name of the knob to the path, open and then read and/or write to it. This is not only extremely clunky and unusual but also inherently racy. There is no conventional way to define transaction across the required steps and nothing can guarantee that the process would actually be operating on its own sub-hierarchy.h]hX)First of all, cgroup has a fundamentally inadequate interface to be exposed this way. For a process to access its own knobs, it has to extract the path on the target hierarchy from /proc/self/cgroup, construct the path by appending the name of the knob to the path, open and then read and/or write to it. This is not only extremely clunky and unusual but also inherently racy. There is no conventional way to define transaction across the required steps and nothing can guarantee that the process would actually be operating on its own sub-hierarchy.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMI hjShhubh)}(hXcgroup controllers implemented a number of knobs which would never be accepted as public APIs because they were just adding control knobs to system-management pseudo filesystem. cgroup ended up with interface knobs which were not properly abstracted or refined and directly revealed kernel internal details. These knobs got exposed to individual applications through the ill-defined delegation mechanism effectively abusing cgroup as a shortcut to implementing public APIs without going through the required scrutiny.h]hXcgroup controllers implemented a number of knobs which would never be accepted as public APIs because they were just adding control knobs to system-management pseudo filesystem. cgroup ended up with interface knobs which were not properly abstracted or refined and directly revealed kernel internal details. These knobs got exposed to individual applications through the ill-defined delegation mechanism effectively abusing cgroup as a shortcut to implementing public APIs without going through the required scrutiny.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMR hjShhubh)}(hThis was painful for both userland and kernel. Userland ended up with misbehaving and poorly abstracted interfaces and kernel exposing and locked into constructs inadvertently.h]hThis was painful for both userland and kernel. Userland ended up with misbehaving and poorly abstracted interfaces and kernel exposing and locked into constructs inadvertently.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM[ hjShhubeh}(h]thread-granularityah ]h"]thread granularityah$]h&]uh1hhjRhhhhhM5 ubh)}(hhh](h)}(h+Competition Between Inner Nodes and Threadsh]h+Competition Between Inner Nodes and Threads}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhjShhhhhMa ubh)}(hXCcgroup v1 allowed threads to be in any cgroups which created an interesting problem where threads belonging to a parent cgroup and its children cgroups competed for resources. This was nasty as two different types of entities competed and there was no obvious way to settle it. Different controllers did different things.h]hXCcgroup v1 allowed threads to be in any cgroups which created an interesting problem where threads belonging to a parent cgroup and its children cgroups competed for resources. This was nasty as two different types of entities competed and there was no obvious way to settle it. Different controllers did different things.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMc hjShhubh)}(hXThe cpu controller considered threads and cgroups as equivalents and mapped nice levels to cgroup weights. This worked for some cases but fell flat when children wanted to be allocated specific ratios of CPU cycles and the number of internal threads fluctuated - the ratios constantly changed as the number of competing entities fluctuated. There also were other issues. The mapping from nice level to weight wasn't obvious or universal, and there were various other knobs which simply weren't available for threads.h]hX The cpu controller considered threads and cgroups as equivalents and mapped nice levels to cgroup weights. This worked for some cases but fell flat when children wanted to be allocated specific ratios of CPU cycles and the number of internal threads fluctuated - the ratios constantly changed as the number of competing entities fluctuated. There also were other issues. The mapping from nice level to weight wasn’t obvious or universal, and there were various other knobs which simply weren’t available for threads.}(hj ThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMi hjShhubh)}(hXThe io controller implicitly created a hidden leaf node for each cgroup to host the threads. The hidden leaf had its own copies of all the knobs with ``leaf_`` prefixed. While this allowed equivalent control over internal threads, it was with serious drawbacks. It always added an extra layer of nesting which wouldn't be necessary otherwise, made the interface messy and significantly complicated the implementation.h](hThe io controller implicitly created a hidden leaf node for each cgroup to host the threads. The hidden leaf had its own copies of all the knobs with }(hjThhhNhNubhliteral)}(h ``leaf_``h]hleaf_}(hj$ThhhNhNubah}(h]h ]h"]h$]h&]uh1j"ThjTubhX prefixed. While this allowed equivalent control over internal threads, it was with serious drawbacks. It always added an extra layer of nesting which wouldn’t be necessary otherwise, made the interface messy and significantly complicated the implementation.}(hjThhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMr hjShhubh)}(hXIThe memory controller didn't have a way to control what happened between internal tasks and child cgroups and the behavior was not clearly defined. There were attempts to add ad-hoc behaviors and knobs to tailor the behavior to specific workloads which would have led to problems extremely difficult to resolve in the long term.h]hXKThe memory controller didn’t have a way to control what happened between internal tasks and child cgroups and the behavior was not clearly defined. There were attempts to add ad-hoc behaviors and knobs to tailor the behavior to specific workloads which would have led to problems extremely difficult to resolve in the long term.}(hjj>j 8j8j8j8jH9jE9j9j9j:j:j>j>jp@jm@jh@je@j&Gj#GjGjGjwGjtGj$Ij!IjIjIjfJjcJj^Jj[JjKjKjKjKjdNjaNj5Nj2Nj\NjYNjNjNjNjNj'Oj$OjNjNjOjOj|QjyQjOjOjPjPj#Qj QjtQjqQjWRjTRjORjLRjRjRjsUjpUj}SjzSjSjSjkTjhTjTjTjkUjhUu nametypes}(j|Uj{Uj"jjj jdjj(jjjjxjjj jZj j j\ j j8 j* j j j j j0 jj j2 jj/OjjjjUj .jc.j.j>j 8j8jH9j9j:j>jp@jh@j&GjGjwGj$IjIjfJj^JjKjKjdNj5Nj\NjNjNj'OjNjOj|QjOjPj#QjtQjWRjORjRjsUj}SjSjkTjTjkUuh}(hhjxUhjjjjjjj j%jaj6jjgj%jxjj+jjjjjujjj{jjj jjWj j j]j j jY j* j j_ j5 j j' j j$ j- j j- j j j j j- j jj; j jL j/ j jj5 j,Ojjjjjjjj.jj.jzj`.j#.j.jf.j>j.j8j.j8j8jE9j8j9jK9j:j9j>j:jm@j>je@j>j#Gjs@jGj@jtGj)Gj!IjzGjIjGjcJj'Ij[JjFIjKjiJjKjJjaNjKj2Nj$LjYNj8NjNjgNjNjxNj$OjNjNjNjOjNjyQj2OjOjCOjPjOj QjPjqQj&QjTRjQjLRjQjRjZRjpUjRjzSjSjSjSjhTjSjTjnTjhUjTjaUjTu footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}jUKsRparse_messages]hsystem_message)}(hhh]h)}(h)Duplicate implicit target name: "memory".h]h-Duplicate implicit target name: “memory”.}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj Vubah}(h]h ]h"]h$]h&]jaUalevelKtypeINFOsourcehlineM uh1j VhjThhhhhM ubatransform_messages](j V)}(hhh]h)}(hhh]h/Hyperlink target "cgroup-v2" is not referenced.}hj-Vsbah}(h]h ]h"]h$]h&]uh1hhj*Vubah}(h]h ]h"]h$]h&]levelKtypej%VsourcehlineKuh1j Vubj V)}(hhh]h)}(hhh]hAHyperlink target "cgroupv2-limits-distributor" is not referenced.}hjGVsbah}(h]h ]h"]h$]h&]uh1hhjDVubah}(h]h ]h"]h$]h&]levelKtypej%VsourcehlineMuh1j Vubj V)}(hhh]h)}(hhh]hFHyperlink target "cgroupv2-protections-distributor" is not referenced.}hjaVsbah}(h]h ]h"]h$]h&]uh1hhj^Vubah}(h]h ]h"]h$]h&]levelKtypej%VsourcehlineMuh1j Vubj V)}(hhh]h)}(hhh]h3Hyperlink target "cgroup-v2-cpu" is not referenced.}hj{Vsbah}(h]h ]h"]h$]h&]uh1hhjxVubah}(h]h ]h"]h$]h&]levelKtypej%VsourcehlineM&uh1j Vube transformerN include_log] decorationNhhub.