All of lore.kernel.org
 help / color / mirror / Atom feed
* + docs-cgroup-document-empty-write-behavior-of-memory-limit-knobs.patch added to mm-new branch
@ 2026-08-28  2:47 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-08-28  2:47 UTC (permalink / raw)
  To: mm-commits, tj, shakeel.butt, roman.gushchin, muchun.song,
	mkoutny, mhocko, hannes, cuitao, akpm

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3966 bytes --]


The patch titled
     Subject: docs: cgroup: document empty-write behavior of memory limit knobs
has been added to the -mm mm-new branch.  Its filename is
     docs-cgroup-document-empty-write-behavior-of-memory-limit-knobs.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/docs-cgroup-document-empty-write-behavior-of-memory-limit-knobs.patch

This patch will later appear in the mm-new branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews.  Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.

The mm-new branch of mm.git is not included in linux-next

If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is included in linux-next

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: Tao Cui <cuitao@kylinos.cn>
Subject: docs: cgroup: document empty-write behavior of memory limit knobs
Date: Wed, 26 Aug 2026 10:17:53 +0800

A maintenance script on a cluster wrote an unset variable into memory.max
of a workload cgroup; the variable expanded to an empty string, the write
succeeded, and the workload in the cgroup was OOM-killed.  Nothing pointed
back at the write, so it took quite some time to trace the OOM kills to
that script.

The memory controller documentation does not say what an empty write does;
the cpuset controller documents its empty-value semantics.  The actual
behavior is that the empty string is accepted as 0.  Reproduced on a k8s
cluster (v1.29, cgroup v2, two-container pod, 384M limit):

  # LIMIT=
  # echo "$LIMIT" > $CG/memory.max
  # echo $?
  0

  m6demo   0/2     OOMKilled   0

  Memory cgroup out of memory: Killed process 339529 (sleep) ... anon-rss:32kB

State it where the interface files are introduced, alongside the existing
notes on units and page rounding.

Link: https://lore.kernel.org/all/aoVUlFdZYLFn_gvJ@tiehlicka/
Link: https://lore.kernel.org/20260826021753.197871-1-cui.tao@linux.dev
Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Koutný <mkoutny@suse.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 Documentation/admin-guide/cgroup-v2.rst |    4 ++++
 1 file changed, 4 insertions(+)

--- a/Documentation/admin-guide/cgroup-v2.rst~docs-cgroup-document-empty-write-behavior-of-memory-limit-knobs
+++ a/Documentation/admin-guide/cgroup-v2.rst
@@ -1315,6 +1315,10 @@ All memory amounts are in bytes.  If a v
 PAGE_SIZE is written, the value may be rounded up to the closest
 PAGE_SIZE multiple when read back.
 
+For the limit files described below, an empty or all-whitespace
+write is accepted and sets the limit to 0.  To disable a limit,
+write "max"; to set it to zero explicitly, write "0".
+
   memory.current
 	A read-only single value file which exists on non-root
 	cgroups.
_

Patches currently in -mm which might be from cuitao@kylinos.cn are

docs-cgroup-document-empty-write-behavior-of-memory-limit-knobs.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-28  2:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28  2:47 + docs-cgroup-document-empty-write-behavior-of-memory-limit-knobs.patch added to mm-new branch Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.