[LTP] [PATCH v1] mmapstress06: Rate limit page-dirtying loop to prevent MemCG OOM-kills
Andrea Cervesato
andrea.cervesato@suse.com
Wed Aug 26 09:58:34 CEST 2026
Hi Wei,
> The goal of this test is to reach memory.max and trigger kernel-driven
> swapping as a direct result of hitting that limit.
> Proactively calling memory.reclaim forces swapping before reaching memory.max,
> meaning the memory limit is never actually reached. Furthermore, if calling memory.reclaim
> after hitting memory.max is too late to prevent OOM-kills on slow storage.
> So i do not think `memory.reclaim` solution can help on our oom failure.
memory.reclaim doesn't run during the pressure, but right after we
reached the memory limit, so OOM killer can be handled by excluding
it from the chain and getting an error instead of an OOM kill. In this
way we know if there's an error while swapping, instead of guessing that
device is too slow.
That's basically what we would do if we want to implement something
that is suitable for all the devices: we disable OOM killer in the cgroup,
we remove any sleep, we give a max runtime and if that is reached, it
means that after a number of attempts we are still not swapping -> TFAIL.
Just notice that what I just described is not so far from what OOM-killer
or memory.reclaim does. The ending result is exactly the same, but we
do things by hand.
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
More information about the ltp
mailing list