From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
To: zhangchujun <zhangchujun@cmss.chinamobile.com>,
akpm@linux-foundation.org
Cc: linux-mm@kvack.org
Subject: Re: [PATCH] mm: page_owner: use %u to print the stack depot handle
Date: Wed, 4 Nov 2026 11:49:58 +0100 [thread overview]
Message-ID: <9a17f507-b8bf-4fc9-b1c6-e1f80001cedf@kernel.org> (raw)
In-Reply-To: <20261104073328.1737-1-zhangchujun@cmss.chinamobile.com>
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');
prev parent reply other threads:[~2026-11-04 10:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
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=9a17f507-b8bf-4fc9-b1c6-e1f80001cedf@kernel.org \
--to=vbabka@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=zhangchujun@cmss.chinamobile.com \
/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 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.