Subject: Re: [PATCH 3/8] mm/bootmem_info: stop using PG_private

From: Lance Yang <[email-masked]>
Date: Tue, 19 May 2026 10:56:31 +0800

On Mon, May 11, 2026 at 04:05:31PM +0200, David Hildenbrand (Arm) wrote:
>Nobody checks PG_private for these pages, and we can happily use
>set_page_private() without setting PG_private. So let's just stop
>setting/clearing PG_private.
>
>Signed-off-by: David Hildenbrand (Arm) <[email-masked]>
>---
> mm/bootmem_info.c | 2 --
> 1 file changed, 2 deletions(-)
>
>diff --git a/mm/bootmem_info.c b/mm/bootmem_info.c
>index a0a1ecdec8d0..6e2aaab3dca9 100644
>--- a/mm/bootmem_info.c
>+++ b/mm/bootmem_info.c
>@@ -19,7 +19,6 @@ void get_page_bootmem(unsigned long info, struct page *page,
> {
> 	BUG_ON(type > 0xf);
> 	BUG_ON(info > (ULONG_MAX >> 4));
>-	SetPagePrivate(page);

Right, the users classify these pages via PageReserved()/bootmem_type(),
not PagePrivate().

So makes sense to not set PG_private in the first place.

> 	set_page_private(page, info << 4 | type);
> 	page_ref_inc(page);
> }
>@@ -32,7 +31,6 @@ void put_page_bootmem(struct page *page)
> 	       type > MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE);
> 
> 	if (page_ref_dec_return(page) == 1) {
>-		ClearPagePrivate(page);

Nothing sets it anymore, so there is nothing to clear here.

LGTM, feel free to add:
Reviewed-by: Lance Yang <[email-masked]>

> 		set_page_private(page, 0);
> 		kmemleak_free_part_phys(PFN_PHYS(page_to_pfn(page)), PAGE_SIZE);
> 		free_reserved_page(page);
>
>-- 
>2.43.0
>
>