Re: [PATCH v2] docs: cgroup: document empty-write behavior of memory limit knobs
From: Shakeel Butt
Date: Wed Aug 26 2026 - 17:46:06 EST
On Wed, Aug 26, 2026 at 10:17:53AM +0800, Tao Cui wrote:
> From: Tao Cui <cuitao@xxxxxxxxxx>
>
> 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/
> Signed-off-by: Tao Cui <cuitao@xxxxxxxxxx>
Acked-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>