All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: page_owner: use %u to print the stack depot handle
@ 2026-11-04  7:33 zhangchujun
  2026-11-04 10:49 ` Vlastimil Babka (SUSE)
  0 siblings, 1 reply; 2+ messages in thread
From: zhangchujun @ 2026-11-04  7:33 UTC (permalink / raw)
  To: akpm; +Cc: vbabka, linux-mm, zhangchujun

stack_record->handle.handle is a depot_stack_handle_t, i.e. an
unsigned 32-bit type. Printing it with %d may display a negative
handle when the extra bits stored in the upper part of the
handle are set, which confuses the users of the page_owner_stacks
debugfs interface.

Use %u instead.

Signed-off-by: zhangchujun <zhangchujun@cmss.chinamobile.com>

diff --git a/mm/page_owner.c b/mm/page_owner.c
index cfc31c92d765..02bb304b53cf 100644
--- a/mm/page_owner.c
+++ b/mm/page_owner.c
@@ -1089,7 +1089,7 @@ static int stack_print(struct seq_file *m, void *v)
 			seq_printf(m, " %pS\n", (void *)entries[i]);
 	}
 	if (ctx->flags & STACK_PRINT_FLAG_HANDLE)
-		seq_printf(m, "handle: %d\n", stack_record->handle.handle);
+		seq_printf(m, "handle: %u\n", stack_record->handle.handle);
 	if (ctx->flags & STACK_PRINT_FLAG_PAGES)
 		seq_printf(m, "nr_base_pages: %d\n", nr_base_pages);
 	seq_putc(m, '\n');
-- 
2.50.1.windows.1





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm: page_owner: use %u to print the stack depot handle
  2026-11-04  7:33 [PATCH] mm: page_owner: use %u to print the stack depot handle zhangchujun
@ 2026-11-04 10:49 ` Vlastimil Babka (SUSE)
  0 siblings, 0 replies; 2+ messages in thread
From: Vlastimil Babka (SUSE) @ 2026-11-04 10:49 UTC (permalink / raw)
  To: zhangchujun, akpm; +Cc: linux-mm

On 11/4/26 08:33, zhangchujun wrote:
> stack_record->handle.handle is a depot_stack_handle_t, i.e. an
> unsigned 32-bit type. Printing it with %d may display a negative
> handle when the extra bits stored in the upper part of the
> handle are set, which confuses the users of the page_owner_stacks
> debugfs interface.
> 
> Use %u instead.
> 
> Signed-off-by: zhangchujun <zhangchujun@cmss.chinamobile.com>

Acked-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>

> diff --git a/mm/page_owner.c b/mm/page_owner.c
> index cfc31c92d765..02bb304b53cf 100644
> --- a/mm/page_owner.c
> +++ b/mm/page_owner.c
> @@ -1089,7 +1089,7 @@ static int stack_print(struct seq_file *m, void *v)
>  			seq_printf(m, " %pS\n", (void *)entries[i]);
>  	}
>  	if (ctx->flags & STACK_PRINT_FLAG_HANDLE)
> -		seq_printf(m, "handle: %d\n", stack_record->handle.handle);
> +		seq_printf(m, "handle: %u\n", stack_record->handle.handle);
>  	if (ctx->flags & STACK_PRINT_FLAG_PAGES)
>  		seq_printf(m, "nr_base_pages: %d\n", nr_base_pages);
>  	seq_putc(m, '\n');



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-04 10:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04  7:33 [PATCH] mm: page_owner: use %u to print the stack depot handle zhangchujun
2026-11-04 10:49 ` Vlastimil Babka (SUSE)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.