Problem: When the number of memory mappings required by a process exceeds the limit set by /proc/sys/vm/max_map_count, new mmap() calls will fail and return an error. In such cases, we need to manually increase the value of this parameter. However, it is often difficult to determine what an appropriate value would be. Solution: This patch introduces a new process-specific proc parameter, /proc/<pid>/max_map_count, which displays the maximum number of memory mappings the process has ever reached. This provides a reference for adjusting the global /proc/sys/vm/max_map_count parameter. Usage: To directly view this parameter for a specific process: cat /proc/1/max_map_count 154 The parameter supports resetting to 0, but writing any other value will result in an error: echo 0 > /proc/1/max_map_count cat /proc/1/max_map_count 0
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/5839