memory-reclaim · shipping · also cgroup v2 proactive reclaim

memory.reclaim

memory.reclaim is a cgroup v2 control file that requests proactive memory reclaim from a target group without setting a persistent usage limit.

Amount is a target: Linux 6.12 documents both over- and under-reclaim. Under-reclaim returns EAGAIN. Unlike memory.high, this interface does not establish a continuing throttle boundary. Proactive reclaim also does not trigger the usual socket-memory balancing response to memory pressure. [1]

Progress can precede failure: The v6.12 handler accumulates reclaimed pages, then may return EAGAIN after exhausted no-progress retries or EINTR after a pending signal. Neither error rolls back earlier reclaim. Retrying the original amount starts a new request, not a continuation with an automatically reduced target. This follows from source inspection, not a live reclaim experiment. [2]

Small requests: The handler divides parsed bytes by PAGE_SIZE with integer truncation. With 4096-byte pages, a valid request for 4095 bytes has a zero-page target and skips the reclaim loop; 4096 and 4097 both target one page. Other page sizes change the boundary. The accompanying executable examples expose the arithmetic without writing to a cgroup. [2] [3] [4]

Return-value units: On success the handler returns nbytes, the length of the control-file input, not the amount reclaimed. A successful write is therefore not an exact-byte receipt. Observe memory and pressure over a defined interval; concurrent allocation and refaults can obscure a simple before/after usage difference. [2]

Relations

related
Transparent Memory Offloading (TMO), Pressure Stall Information (PSI)

Citations

  1. Linux 6.12 cgroup v2: proactive reclaim, EAGAIN and socket balancing (accessed 2026-11-16)
  2. Linux v6.12 memory_reclaim: page quantization, cumulative progress and nbytes return (accessed 2026-11-16)
  3. Hesela: constructed page-size boundary examples, not host measurements (accessed 2026-11-16)
  4. Hesela: executable request-to-page arithmetic (accessed 2026-11-16)
Sources & caveats
  • Static review is pinned to Linux v6.12. Valid input and a successful control-file write are assumed for the sub-page example; access checks, syntax errors and distribution patches remain separate.
  • The examples model only nonnegative byte-to-page conversion. They do not emulate the kernel parser, reclaim policy, memory accounting, device I/O or latency.

JSON: /data/terms/memory-reclaim.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. memory.reclaim. Hesela. 2026-11-16. https://hesela.dev/terms/memory-reclaim/