public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Jiayuan Liang <ljykernel@163.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, Jiayuan Liang <ljykernel@163.com>
Subject: [PATCH v2] mm/page_owner: warn when stack trace depth hits PAGE_OWNER_STACK_DEPTH limit
Date: Sun, 29 Mar 2026 05:44:08 +0800	[thread overview]
Message-ID: <20260328214408.2990597-1-ljykernel@163.com> (raw)

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.

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..962a4f694 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\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  7:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <JR421L42D7V@zendesk.com>
2026-03-28 21:44 ` Jiayuan Liang [this message]
2026-03-28 17:28   ` [syzbot ci] Re: mm/page_owner: warn when stack trace depth hits PAGE_OWNER_STACK_DEPTH limit 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

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=20260328214408.2990597-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