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

From: Lance Yang

Date: Fri Jul 03 2026 - 10:59:55 EST




On 2026/7/3 21:47, Zi Yan wrote:
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>
Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
---

LGTM. Feel free to add:

Reviewed-by: Lance Yang <lance.yang@xxxxxxxxx>

mm/internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/internal.h b/mm/internal.h
index fa4fb69444ecd..fbd9fb84341bc 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -902,7 +902,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,