Re: [PATCH 1/3] mm/page_owner: add option 'print_handle' for 'show_stacks'

From: Mauricio Faria de Oliveira
Date: Thu Sep 25 2025 - 18:26:27 EST


On 2025-09-25 17:28, Joshua Hahn wrote:
> On Wed, 24 Sep 2025 14:40:21 -0300 Mauricio Faria de Oliveira <mfo@xxxxxxxxxx> wrote:
>
>> For monitoring the memory usage per stack trace, it is more efficient to
>> use the handle number as unique identifier of a stack trace than to, for
>> example, read/hash all stack traces to uniquely identify them everytime.
>>
>> The handle number is a unique identifier for stack traces in stackdepot.
>>
>> This patch adds the option 'print_handle' to print the handle number of
>> stack traces in 'show_stacks'.
>
>> @@ -887,6 +887,7 @@ static void *stack_next(struct seq_file *m, void *v, loff_t *ppos)
>> }
>>
>> static unsigned long page_owner_pages_threshold;
>> +static bool page_owner_print_handle;
>
> Hi Mauricio,
>
> Quick nit -- If I understand your cover letter correctly, you want
> page_owner_print_handle to be false by default, should we initialize this
> to false?

Hey Joshua,

In this case, it is not needed, as static variables don't need to be
initialized to false/0. This is handled as an error in checkpatch.pl,
so it should not be added even for completeness.

Thanks for checking this.

--
Mauricio