[LTP] [PATCH v1] mmapstress06: TCONF on systems without swap space

Li Wang li.wang@linux.dev
Thu Apr 30 10:01:12 CEST 2026


Hi Wei, Petr,

Wei Gao via ltp wrote:

> Base description/implementation of test case, The original test is "passive," merely creating a 
> mapping and relying on external processes to trigger swapping(case has sleep_time parameter).
> Further more, this case is "ghost test" for current kernel, it do mmap but never 
> writes to it, so kernel never actually allocated memory, 
> Together with current obsolete logic(test targets legcy mfile_swap) i suggest just delete 
> it instead of wasting time patching(refactor) it. What do you think? @Petr @wang li?

After looking into the details of mmapstress06, I agree that this
test only simulates progress and still requires another stress
tester to create memory pressure and trigger swapping.

Instead of removing this test, I prefer to refactor it into a
new API and encapsulate the orignial method within Cgroups.

e.g.

 1. Check system swap availability
 2. Create cgroup with memory.max and memory.swap.max limits
 3. Create large anonymous shared mapping (original size)
 4. Allocate stress region: size > memory.max in child
 5. Ditry every page in stress region
 6. Check process VmSwap increase
 7. Cleanup


-- 
Regards,
Li Wang


More information about the ltp mailing list