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) Acked-by: David Hildenbrand (Arm) Reviewed-by: Lance Yang Signed-off-by: Zi Yan --- 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