docs: cgroup: Explain reclaim protection target

The protection target is necessary to understand how effective reclaim
protection applies in the hierarchy.

Signed-off-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
Michal Koutný 2025-11-14 19:21:25 +01:00 committed by Tejun Heo
parent 1dc830ee4c
commit e27179958c
1 changed files with 21 additions and 3 deletions

View File

@ -53,7 +53,8 @@ v1 is available under :ref:`Documentation/admin-guide/cgroup-v1/index.rst <cgrou
5-2. Memory 5-2. Memory
5-2-1. Memory Interface Files 5-2-1. Memory Interface Files
5-2-2. Usage Guidelines 5-2-2. Usage Guidelines
5-2-3. Memory Ownership 5-2-3. Reclaim Protection
5-2-4. Memory Ownership
5-3. IO 5-3. IO
5-3-1. IO Interface Files 5-3-1. IO Interface Files
5-3-2. Writeback 5-3-2. Writeback
@ -1317,7 +1318,7 @@ PAGE_SIZE multiple when read back.
smaller overages. smaller overages.
Effective min boundary is limited by memory.min values of Effective min boundary is limited by memory.min values of
all ancestor cgroups. If there is memory.min overcommitment ancestor cgroups. If there is memory.min overcommitment
(child cgroup or cgroups are requiring more protected memory (child cgroup or cgroups are requiring more protected memory
than parent will allow), then each child cgroup will get than parent will allow), then each child cgroup will get
the part of parent's protection proportional to its the part of parent's protection proportional to its
@ -1343,7 +1344,7 @@ PAGE_SIZE multiple when read back.
smaller overages. smaller overages.
Effective low boundary is limited by memory.low values of Effective low boundary is limited by memory.low values of
all ancestor cgroups. If there is memory.low overcommitment ancestor cgroups. If there is memory.low overcommitment
(child cgroup or cgroups are requiring more protected memory (child cgroup or cgroups are requiring more protected memory
than parent will allow), then each child cgroup will get than parent will allow), then each child cgroup will get
the part of parent's protection proportional to its the part of parent's protection proportional to its
@ -1934,6 +1935,23 @@ memory - is necessary to determine whether a workload needs more
memory; unfortunately, memory pressure monitoring mechanism isn't memory; unfortunately, memory pressure monitoring mechanism isn't
implemented yet. implemented yet.
Reclaim Protection
~~~~~~~~~~~~~~~~~~
The protection configured with "memory.low" or "memory.min" applies relatively
to the target of the reclaim (i.e. any of memory cgroup limits, proactive
memory.reclaim or global reclaim apparently located in the root cgroup).
The protection value configured for B applies unchanged to the reclaim
targeting A (i.e. caused by competition with the sibling E)::
root - ... - A - B - C
\ ` D
` E
When the reclaim targets ancestors of A, the effective protection of B is
capped by the protection value configured for A (and any other intermediate
ancestors between A and the target).
Memory Ownership Memory Ownership
~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~