[PATCH v3 5/5] mm/page_alloc: remove set_page_private() in prep_compound_tail()

From: Zi Yan

Date: Thu Jul 09 2026 - 14:08:30 EST


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.

Acked-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
Reviewed-by: Lance Yang <lance.yang@xxxxxxxxx>
Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
---
mm/internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/internal.h b/mm/internal.h
index 841c27611627e..398741a8ab092 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,

--
2.53.0