* [PATCH] mm/page_owner: add warning when stack depth exceeds PAGE_OWNER_STACK_DEPTH
@ 2026-03-28 21:16 Jiayuan Liang
0 siblings, 0 replies; only message in thread
From: Jiayuan Liang @ 2026-03-28 21:16 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, Jiayuan Liang
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-03-28 6:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-28 21:16 [PATCH] mm/page_owner: add warning when stack depth exceeds PAGE_OWNER_STACK_DEPTH Jiayuan Liang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox