The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Vishal Moola <vishal.moola@gmail.com>
To: Yichong Chen <chenyichong@uniontech.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH v3] tools/mm/page_owner_sort: free per-record allocations
Date: Mon, 15 Jun 2026 13:24:00 +0100	[thread overview]
Message-ID: <ai_u4Mfr1KMacaED@fedora> (raw)
In-Reply-To: <610C3A89A09303F8+20260612055017.632263-1-chenyichong@uniontech.com>

On Fri, Jun 12, 2026 at 01:50:17PM +0800, Yichong Chen wrote:
> add_list() allocates comm and txt for each page owner record, but the
> cleanup path only frees the outer list array. This leaks both buffers for
> every retained record.
> 
> Free partial allocations in add_list(), discarded records during
> culling, and retained records on exit. Return explicit error, skip, and
> match results from filter_record() to handle get_comm() failures.

Nit: IMO its bad practice to rename function names without stating it in
the commit log. Especially if you reference its behavior in that commit
log.

> 
> Signed-off-by: Yichong Chen <chenyichong@uniontech.com>
> ---

I like the enum approach. Splitting it out and having this as a 2-patch
series would have made sense too (since doing it this way has
2 distinct logical changes).

Whether combined or split, you can add my tag:

Reviewed-by: Vishal Moola <vishal.moola@gmail.com>

      reply	other threads:[~2026-06-15 12:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-12  5:50 [PATCH v3] tools/mm/page_owner_sort: free per-record allocations Yichong Chen
2026-06-15 12:24 ` Vishal Moola [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ai_u4Mfr1KMacaED@fedora \
    --to=vishal.moola@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=chenyichong@uniontech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox