[LTP] [PATCH v1 2/2] memcontrol03, memcontrol04: Set protection on parent cgroups to prevent kswapd over-reclaim
Michal Koutný
mkoutny@suse.com
Mon Oct 5 17:37:46 CEST 2026
Hello Wei.
On Sun, Oct 04, 2026 at 02:33:27PM +0000, Wei Gao <wegao@suse.com> wrote:
> On NUMA systems (observed on PowerPC), allocating memory can trigger
> node-level memory pressure, waking up kswapd when free pages fall below
> the low watermark on a node.
>
> In cgroup v2, both hard protection (memory.min) and best-effort protection
> (memory.low) are hierarchical and calculated top-down: effective
> protection of descendant cgroups is bounded by their ancestors' protection
> values. When LTP runs inside an existing cgroup hierarchy, ancestor cgroups
> above the test root have memory.min and memory.low set to 0.
Note that this is expected behavior of protection and the test is meant
to work "relatively" with its own pressure source and target [1].
> As a result, when kswapd performs node-level background reclaim from the
> root cgroup downwards, ancestor cgroups without protection provide no
> protection boundary. kswapd reclaims pages from descendant leaf cgroups
> regardless of their local memory.min / memory.low settings, causing
> memcontrol03 and memcontrol04 to fail with over-reclaim:
Generally, this is not specific to this test -- it is because it the
whole host is overcommitted (edit: as I see the NUMA info below it could
be perhaps that only individual nodes are too small).
So I wonder could this be ensured at higher level -- something that sets
up the environment of the individual runners (e.g. reduce parallelism,
partition the system with memory limits or as a variant configure
generic memory protection)?
WDYT?
Michal
[1] https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html#reclaim-protection
More information about the ltp
mailing list