linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Memory reclaim documentation fixes
@ 2020-07-29 14:05 Michal Koutný
  2020-07-29 14:05 ` [PATCH 1/3] docs: cgroup: Explain reclaim protection target Michal Koutný
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michal Koutný @ 2020-07-29 14:05 UTC (permalink / raw)
  To: cgroups, linux-doc
  Cc: linux-kernel, Tejun Heo, Li Zefan, Johannes Weiner, Jonathan Corbet

Hi,
I think the reclaim target is a concept that is not just an
implementation detail and hence it should be documented how it applies
to protection configuration (the first patch). Second patch is a "best
practice" bit of information, it may be squashed with the first one. The
last patch just makes docs indefinite until the idea is implemented.


Michal Koutný (3):
  docs: cgroup: Explain reclaim protection target
  docs: cgroup: Note about sibling relative reclaim protection
  docs: cgroup: No special handling of unpopulated memcgs

 Documentation/admin-guide/cgroup-v2.rst | 31 ++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 6 deletions(-)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] docs: cgroup: Explain reclaim protection target
  2020-07-29 14:05 [PATCH 0/3] Memory reclaim documentation fixes Michal Koutný
@ 2020-07-29 14:05 ` Michal Koutný
  2020-07-29 14:05 ` [PATCH 2/3] docs: cgroup: Note about sibling relative reclaim protection Michal Koutný
  2020-07-29 14:05 ` [PATCH 3/3] docs: cgroup: No special handling of unpopulated memcgs Michal Koutný
  2 siblings, 0 replies; 4+ messages in thread
From: Michal Koutný @ 2020-07-29 14:05 UTC (permalink / raw)
  To: cgroups, linux-doc
  Cc: linux-kernel, Tejun Heo, Li Zefan, Johannes Weiner, Jonathan Corbet

Signed-off-by: Michal Koutný <mkoutny@suse.com>
---
 Documentation/admin-guide/cgroup-v2.rst | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index d09471aa7443..94bdff4f9e09 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -47,7 +47,8 @@ v1 is available under :ref:`Documentation/admin-guide/cgroup-v1/index.rst <cgrou
      5-2. Memory
        5-2-1. Memory Interface Files
        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-1. IO Interface Files
        5-3-2. Writeback
@@ -1113,7 +1114,7 @@ PAGE_SIZE multiple when read back.
 	smaller overages.
 
 	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
 	than parent will allow), then each child cgroup will get
 	the part of parent's protection proportional to its
@@ -1139,7 +1140,7 @@ PAGE_SIZE multiple when read back.
 	smaller overages.
 
 	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
 	than parent will allow), then each child cgroup will get
 	the part of parent's protection proportional to its
@@ -1449,6 +1450,23 @@ memory - is necessary to determine whether a workload needs more
 memory; unfortunately, memory pressure monitoring mechanism isn't
 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 or global
+pressure located in the root cgroup).
+
+  ... - A - B - C
+              \ D
+          \ E
+
+The protection value configured for B applies unchanged to the reclaim
+targeting A (i.e. caused by competition with the sibling 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
 ~~~~~~~~~~~~~~~~
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] docs: cgroup: Note about sibling relative reclaim protection
  2020-07-29 14:05 [PATCH 0/3] Memory reclaim documentation fixes Michal Koutný
  2020-07-29 14:05 ` [PATCH 1/3] docs: cgroup: Explain reclaim protection target Michal Koutný
@ 2020-07-29 14:05 ` Michal Koutný
  2020-07-29 14:05 ` [PATCH 3/3] docs: cgroup: No special handling of unpopulated memcgs Michal Koutný
  2 siblings, 0 replies; 4+ messages in thread
From: Michal Koutný @ 2020-07-29 14:05 UTC (permalink / raw)
  To: cgroups, linux-doc
  Cc: linux-kernel, Tejun Heo, Li Zefan, Johannes Weiner, Jonathan Corbet

Signed-off-by: Michal Koutný <mkoutny@suse.com>
---
 Documentation/admin-guide/cgroup-v2.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index 94bdff4f9e09..47f9f056e66f 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -1467,6 +1467,10 @@ 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).
 
+To express indifference about relative sibling protection, it is suggested to
+use memory_recursiveprot. Configuring all descendants of a parent with finite
+protection to "max" works but it may unnecessarily skew memory.events:low
+field.
 
 Memory Ownership
 ~~~~~~~~~~~~~~~~
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] docs: cgroup: No special handling of unpopulated memcgs
  2020-07-29 14:05 [PATCH 0/3] Memory reclaim documentation fixes Michal Koutný
  2020-07-29 14:05 ` [PATCH 1/3] docs: cgroup: Explain reclaim protection target Michal Koutný
  2020-07-29 14:05 ` [PATCH 2/3] docs: cgroup: Note about sibling relative reclaim protection Michal Koutný
@ 2020-07-29 14:05 ` Michal Koutný
  2 siblings, 0 replies; 4+ messages in thread
From: Michal Koutný @ 2020-07-29 14:05 UTC (permalink / raw)
  To: cgroups, linux-doc
  Cc: linux-kernel, Tejun Heo, Li Zefan, Johannes Weiner, Jonathan Corbet

The current kernel doesn't handle unpopulated cgroups any special
regarding reclaim protection. Furthermore, this wasn't a case even when
this was introduced in
    bf8d5d52ffe89 ("memcg: introduce memory.min")
Drop the incorrect documentation. (Implementation taking into account
the inner-node constraint may be added later.)

Signed-off-by: Michal Koutný <mkoutny@suse.com>
---
 Documentation/admin-guide/cgroup-v2.rst | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index 47f9f056e66f..3d62922c4499 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -1123,9 +1123,6 @@ PAGE_SIZE multiple when read back.
 	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.
-
   memory.low
 	A read-write single value file which exists on non-root
 	cgroups.  The default is "0".
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-29 14:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-29 14:05 [PATCH 0/3] Memory reclaim documentation fixes Michal Koutný
2020-07-29 14:05 ` [PATCH 1/3] docs: cgroup: Explain reclaim protection target Michal Koutný
2020-07-29 14:05 ` [PATCH 2/3] docs: cgroup: Note about sibling relative reclaim protection Michal Koutný
2020-07-29 14:05 ` [PATCH 3/3] docs: cgroup: No special handling of unpopulated memcgs Michal Koutný

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).