From 819bfbd47e49df893bd1ae26af2e772629452897 Mon Sep 17 00:00:00 2001 From: Zi Yan Date: Thu, 9 Jul 2026 14:06:05 -0400 Subject: [PATCH] mm/page_alloc: remove set_page_private() in prep_compound_tail() Tail pages are expected to have (and optionally be checked) zeroed ->private when they are freed. It stays true during subsequent reallocation, so replace the tail_page->private initialization with a VM_WARN_ON_ONCE() in compound page preparation. Link: https://lore.kernel.org/20260709-keep-subpage-private-zero-at-free-v3-5-7e4fe155f5b9@nvidia.com Signed-off-by: Zi Yan Acked-by: Vlastimil Babka (SUSE) Acked-by: David Hildenbrand (Arm) Reviewed-by: Lance Yang Cc: Alistair Popple Cc: Baolin Wang Cc: Barry Song Cc: Brendan Jackman Cc: Brendan Jackman Cc: Dennis Zhou Cc: Dev Jain Cc: Johannes Weiner Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Nico Pache Cc: Ryan Roberts Cc: Suren Baghdasaryan Cc: Tejun Heo Signed-off-by: Andrew Morton --- mm/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/internal.h b/mm/internal.h index 841c27611627..398741a8ab09 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -741,7 +741,7 @@ static inline void prep_compound_tail(struct page *tail, { tail->mapping = TAIL_MAPPING; set_compound_head(tail, head, order); - set_page_private(tail, 0); + VM_WARN_ON_ONCE(tail->private); } static inline void init_compound_tail(struct page *tail,