From: Andrew Morton <akpm@linux-foundation.org>
To: Jiayuan Liang <ljykernel@163.com>
Cc: linux-mm@kvack.org
Subject: Re: [PATCH v2] mm/page_owner: warn when stack trace depth hits PAGE_OWNER_STACK_DEPTH limit
Date: Mon, 30 Mar 2026 13:48:13 -0700 [thread overview]
Message-ID: <20260330134813.084a2becac8ffc3cca99e1d5@linux-foundation.org> (raw)
In-Reply-To: <20260328214408.2990597-1-ljykernel@163.com>
On Sun, 29 Mar 2026 05:44:08 +0800 Jiayuan Liang <ljykernel@163.com> wrote:
> page_owner silently truncates stack traces deeper than
> PAGE_OWNER_STACK_DEPTH (16), which hides root caller information during
> memory debugging.
>
> Add a ratelimited warning to notify developers when this truncation occurs.
>
> ...
>
> --- a/mm/page_owner.c
> +++ b/mm/page_owner.c
> @@ -163,6 +163,9 @@ static noinline depot_stack_handle_t save_stack(gfp_t flags)
>
> set_current_in_page_owner();
> nr_entries = stack_trace_save(entries, ARRAY_SIZE(entries), 2);
> + if (nr_entries >= PAGE_OWNER_STACK_DEPTH)
> + pr_warn_ratelimited("page_owner: stack depth %u exceeds limit %u\n",
> + nr_entries, PAGE_OWNER_STACK_DEPTH);
> handle = stack_depot_save(entries, nr_entries, flags);
> if (!handle)
> handle = failure_handle;
Is it ideal to emit this warning in real time? Would it be better to
tell the user "this was truncated" when they actually _use_ the data?
Presumably this would require alteration to page_owner_sort.c and
page_owner.rst.
prev parent reply other threads:[~2026-03-30 20:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <JR421L42D7V@zendesk.com>
2026-03-28 21:44 ` Jiayuan Liang
2026-03-28 17:28 ` [syzbot ci] " syzbot ci
2026-03-28 17:28 ` Request received Yail
2026-03-28 17:39 ` [syzbot ci] Re: mm/page_owner: warn when stack trace depth hits PAGE_OWNER_STACK_DEPTH limit Andrew Morton
2026-03-30 20:48 ` Andrew Morton [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=20260330134813.084a2becac8ffc3cca99e1d5@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=ljykernel@163.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox