[LTP] [PATCH v2] syscalls/mlock05: add mlock test for locking and pre-faulting of memory
Cyril Hrubis
chrubis@suse.cz
Thu May 2 12:09:04 CEST 2024
Hi!
> After some investigation, I realized the issue is caused by the
> unreliability of the VmRSS field in /proc/$pid/status.
> Documentation suggests to use /proc/$pid/smaps for reliable information.
>
> This file contains information about each memory mapping, so it contains
> multiple instances of the VmRss field (In this file is simply referred as
> Rss).
>
> I managed to run the test without any failures using a custom function.
> What we need to do is to iterate through the memory mappings until we find
> the one we need. We can use the memory address retrieved by mmap to locate
> the desired one.
>
> Once we find the mapping, we can then search the Rss field.
>
> This is the output I had using this approach:
>
> TPASS: Expect: (VmRSS=1048576) >= (MMAPLEN=1048576)
> TPASS: VmLck == MMAPLEN (1048576)
>
> Summary:
> passed 20000
> failed 0
> broken 0
> skipped 0
> warnings 0
>
> Do you think this can work as a solution or you prefer another way around?
Looking up the right mapping and checking that the size of the resident
set is as expected sounds good to me.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list