From: Jiayuan Liang <ljykernel@163.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, Jiayuan Liang <ljykernel@163.com>
Subject: [PATCH] mm/page_owner: add warning when stack depth exceeds PAGE_OWNER_STACK_DEPTH
Date: Sun, 29 Mar 2026 05:16:17 +0800 [thread overview]
Message-ID: <20260328211617.2985292-1-ljykernel@163.com> (raw)
mm/page_owner: warn when stack trace depth hits PAGE_OWNER_STACK_DEPTH limit
Signed-off-by: Jiayuan Liang <ljykernel@163.com>
---
mm/page_owner.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/page_owner.c b/mm/page_owner.c
index 8178e0be5..82c107455 100644
--- 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, trace truncated\n",
+ nr_entries, PAGE_OWNER_STACK_DEPTH);
handle = stack_depot_save(entries, nr_entries, flags);
if (!handle)
handle = failure_handle;
--
2.43.0
reply other threads:[~2026-03-28 6:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260328211617.2985292-1-ljykernel@163.com \
--to=ljykernel@163.com \
--cc=akpm@linux-foundation.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