Skip to contentSkip to conversation

mm/page_owner: move save_stack() entries array to per-CPU storage

RFC Kanishka Solanki 1 participant 1 message Dec 2 Memory management

lore
Share & tools
lore
#0 lore raw

From: Kanishka <[email protected]>

Hi,

I came across the following TODO in mm/page_owner.c:

/*
* TODO: teach PAGE_OWNER_STACK_DEPTH (__dump_page_owner and save_stack)
* to use off stack temporal storage
*/

I would like to work on a patch to move this temporary array in save_stack() to per-CPU storage to reduce stack usage in deep allocation paths. I saw a similar pattern in kernel/trace/trace.c (ftrace_stacks), which uses per-CPU stack trace buffers.

Before writing the patch, I wanted to check:
1. Is this cleanup still desired?
2. If so, is per-CPU storage the direction you'd prefer, and how would you want nested calls on the same CPU handled (e.g. an interrupt arriving mid-trace)?

Thanks,
Kanishka