Skip to contentSkip to conversation

mm/page_owner: add warning when stack depth exceeds PAGE_OWNER_STACK_DEPTH

PATCH New Jiayuan Liang 1 participant 1 message Mar 28

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/page_owner: add warning when stack depth exceeds PAGE_OWNER_STACK_DEPTH

mm/page_owner: warn when stack trace depth hits PAGE_OWNER_STACK_DEPTH limit

---
 mm/page_owner.c | 3 +++
 1 file changed, 3 insertions(+)
mm/page_owner.c +3 -0
index 8178e0be5..82c107455 100644
@@ -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;
Signature · 1 line
2.43.0