[LTP] [PATCH] mmap_24-1: update code comments
Petr Vorel
pvorel@suse.cz
Mon May 12 15:26:29 CEST 2025
Hi Li,
> Follow-up: mmap_24-1: Change vm.max_map_count if needed
Thanks!
...
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-1.c
> @@ -7,15 +7,23 @@
> * source tree.
> *
> * The mmap() function shall fail if:
> - * [ENOMEM] MAP_FIXED was specified, and the range [addr,addr+len)
> + * [ENOMEM] MAP_FIXED was specified, and the range [addr, addr+len)
> * exceeds that allowed for the address space of a process;
> - * or, if MAP_FIXED was not specified and
> - * there is insufficient room in the address space to effect the mapping.
> + * or, if MAP_FIXED was not specified and there is insufficient room
> + * in the address space to effect the mapping;
> + * or, if the process exceeds the maximum number of allowed memory mappings
> + * (as defined by /proc/sys/vm/max_map_count).
> *
> * Test Steps:
> - * 1. In a very long loop, keep mapping a shared memory object,
> - * until there this insufficient room in the address space;
> - * 3. Should get ENOMEM.
> + * 1. In a very long loop, continuously map a shared memory object without
> + * unmapping previous ones.
> + * 2. The loop continues until mmap() fails with ENOMEM.
> + *
> + * Note:
> + * This failure may occur due to either exhausting the process's
> + * virtual address space, or hitting the system-wide limit on
> + * the number of memory mappings (especially on systems with large RAM).
> + *
nit: please remove before commit this blank line.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
> */
More information about the ltp
mailing list