[PATCH v4 0/2] tools/mm/page_owner_sort: split filter cleanup and allocation fix

From: Yichong Chen

Date: Tue Jun 16 2026 - 01:59:47 EST


Hi,

Split the v3 change into two patches as suggested by Vishal.

Patch 1 renames is_need() to filter_record() and makes the filter path
return explicit results. Patch 2 fixes the per-record allocation leaks.

Changes in v4:
- Split the filter_record() cleanup into a separate patch.
- Mention the is_need() to filter_record() rename in the commit log.
- Add Reviewed-by from Vishal.

Changes in v3:
- Keep the free in add_list(), since incomplete records are not included
in list_size and cannot be reached by the common cleanup path.
- Return explicit error, skip, and match results from filter_record() to
handle a NULL return from get_comm().

Changes in v2:
- Wrap commit message lines to approximately 75 columns.
- Use "Yichong Chen" as the author name.

Yichong Chen (2):
tools/mm/page_owner_sort: return explicit filter results
tools/mm/page_owner_sort: free per-record allocations

tools/mm/page_owner_sort.c | 60 +++++++++++++++++++++++++++++++-------
1 file changed, 49 insertions(+), 11 deletions(-)

--
2.51.0