v1 2026-09-01

page_owner增加过滤功能 · v1

为 page_owner 增加 PID/TGID/COMM(通配符)及 memory cgroup 路径过滤,在 kernel 层裁剪输出以提高效率。

原始补丁链接

子 Patch(8)

1/8
mm/page_owner: Add PID filtering support
Add PID filtering support. Users can filter page_owner output by process IDs using the “pid=<pid_list>” command format. The filter supports up to 16 PIDs specified as a comma-separated list. PIDs are
2/8
mm/page_owner: Add TGID filtering support
Extend filter to support thread group ID (TGID) filtering alongside PID filtering. Reuses existing PID parsing and binary search infrastructure with separate TGID list and count fields. Signed-off-by
3/8
mm/page_owner: Add COMM filtering with wildcard support
Add process name (COMM) filtering to page_owner with glob-style wildcard pattern matching support. Users can now filter page_owner output by process names using flexible patterns. Supported wildcards
4/8
mm/page_owner: Refactor memcg handling for cgroup filter support
[mm/page_owner: Refactor memcg handling for cgroup filter support] Extract memcg information retrieval from printing logic to prepare for cgroup filtering support. Introduce struct memcg_info to hold
5/8
mm/page_owner: Add memcg filter support
Add memory cgroup filtering to page_owner to allow filtering pages by their memcg path. This helps debug memory usage patterns for specific cgroups. Users can now filter page_owner output to show only
6/8
tools/mm: Add PID/TGID/COMM filtering support to page_owner_filter
Add command-line options for filtering by process ID (PID), thread group ID (TGID), and process name (COMM) to the page_owner_filter userspace tool. New options: -p, –pid PID_LIST : Process IDs
7/8
tools/mm: Add memory cgroup filtering support to page_owner_filter
Add filtering capability for page_owner to allow filtering by memory cgroup path. Filter page_owner output by cgroup path: ./page_owner_filter -g / ./page_owner_filter -g /user.slice ./page_owner_fil
8/8
Documentation: page_owner: Document PID/TGID/COMM and cgroup filters
Update page_owner.rst to document process and cgroup filtering support in page_owner_filter tool. Add usage examples for PID, TGID, COMM (with wildcard support), and cgroup filters along with their re