From: Oscar Salvador <osalvador@suse.de>
To: Zhen Ni <zhen.ni@easystack.cn>
Cc: akpm@linux-foundation.org, vbabka@kernel.org, surenb@google.com,
mhocko@suse.com, jackmanb@google.com, hannes@cmpxchg.org,
ziy@nvidia.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org,
SeongJae Park <sj@kernel.org>
Subject: Re: [PATCH v6 1/3] mm/page_owner: add print_mode filter
Date: Mon, 11 May 2026 10:29:35 +0200 [thread overview]
Message-ID: <agGTb37oElM7rff7@localhost.localdomain> (raw)
In-Reply-To: <20260511033017.747781-2-zhen.ni@easystack.cn>
On Mon, May 11, 2026 at 11:30:15AM +0800, Zhen Ni wrote:
> Add a print_mode filter to page_owner that allows users to choose between
> printing full stack traces or only stack handles, significantly reducing
> output size for debugging and analysis.
>
> The filter provides a string-based interface under
> /sys/kernel/debug/page_owner_filter/:
> - Reading shows the current mode with [] brackets around active option
> - Writing accepts "full_stack" or "stack_handle" strings
>
> The default full_stack mode maintains backward compatibility with existing
> usage, displaying complete stack traces for each page allocation.
>
> The stack_handle mode dramatically reduces log size by showing only
> the handle number instead of the full stack trace. The mapping from
> handles to actual stack traces can be obtained via the
> show_stacks_handles interface.
>
> Example usage:
> # echo stack_handle > /sys/kernel/debug/page_owner_filter/print_mode
> # cat /sys/kernel/debug/page_owner_filter/print_mode
> full_stack [stack_handle]
> # cat /sys/kernel/debug/page_owner
> Page allocated via order 0, migratetype Unmovable, gfp_mask 0x1100ca,
> pid 1, tgid 1 (systemd), ts 123456789 ns
> PFN 0x1000 type Unmovable Block 1 type Unmovable
> Flags 0x3fffe800000084(referenced|lru|active|private|node=0|zone=1)
> handle: 17432583
> ...
>
> Reviewed-by: SeongJae Park <sj@kernel.org>
> Signed-off-by: Zhen Ni <zhen.ni@easystack.cn>
Overall looks good to me, one comment below
Reviewed-by: Oscar Salvador <osalvador@suse.de>
> ---
...
> ---
> mm/page_owner.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 80 insertions(+), 2 deletions(-)
>
> diff --git a/mm/page_owner.c b/mm/page_owner.c
> index 8178e0be557f..27a412c52d41 100644
> --- a/mm/page_owner.c
> +++ b/mm/page_owner.c
> @@ -1,5 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0
> #include <linux/debugfs.h>
> +#include <linux/fs.h>
Why do we need this?
--
Oscar Salvador
SUSE Labs
next prev parent reply other threads:[~2026-05-11 8:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 3:30 [PATCH v6 0/3] mm/page_owner: add filter infrastructure for print_mode and NUMA filtering Zhen Ni
2026-05-11 3:30 ` [PATCH v6 1/3] mm/page_owner: add print_mode filter Zhen Ni
2026-05-11 8:29 ` Oscar Salvador [this message]
2026-05-11 11:54 ` zhen.ni
2026-05-11 3:30 ` [PATCH v6 2/3] mm/page_owner: add NUMA node filter with nodelist support Zhen Ni
2026-05-11 8:54 ` Oscar Salvador
2026-05-11 12:24 ` zhen.ni
2026-05-11 3:30 ` [PATCH v6 3/3] mm/page_owner: document page_owner filter features Zhen Ni
2026-05-11 8:33 ` Oscar Salvador
2026-05-11 12:23 ` [PATCH v6 0/3] mm/page_owner: add filter infrastructure for print_mode and NUMA filtering Michal Hocko
2026-05-11 12:40 ` zhen.ni
2026-05-11 12:54 ` Michal Hocko
2026-05-12 3:11 ` zhen.ni
2026-05-12 7:26 ` Michal Hocko
2026-05-12 8:16 ` zhen.ni
2026-05-12 8:54 ` Michal Hocko
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=agGTb37oElM7rff7@localhost.localdomain \
--to=osalvador@suse.de \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=jackmanb@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=sj@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=zhen.ni@easystack.cn \
--cc=ziy@nvidia.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.