Bug 25523 - anolis: mm: Add a proc interface to display the maximum number of memory mappings the process has ever reached
Summary: anolis: mm: Add a proc interface to display the maximum number of memory mapp...
Status: NEW
Alias: None
Product: ANCK 6.6 Dev
Classification: ANCK
Component: mm (show other bugs) mm
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: baolinwang
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-07 19:37 UTC by wangyaxin
Modified: 2025-10-07 19:41 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wangyaxin 2025-10-07 19:37:07 UTC
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
Comment 1 小龙 admin 2025-10-07 19:41:18 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/5839