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

From: Vlastimil Babka (SUSE)

Date: Mon Jun 29 2026 - 12:03:36 EST


On 6/29/26 04:56, Zi Yan wrote:
> With the subpage->private == 0 check added in a prior commit, any allocated
> compound page should not have nonzero subpage->private. Remove the

(not "subpage")

I think the sentence would be more precise if it said that we now expect
(and optionally check) tail pages to have zero ->private when they are
freed, so we can rely on that still being true during subsequent reallocation.

(and if the buddy allocator itself sets it to non-zero due to split/merge of
buddy pages, it will reset it to zero as well as appropriate, but maybe that
doesn't need spelling out)

> unnecessary subpage->private initialization code in compound page
> preparation.
>
> Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>

Acked-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>

> ---
> mm/internal.h | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/mm/internal.h b/mm/internal.h
> index 181e79f1d6a2..c96421ce9350 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -895,7 +895,6 @@ static inline void prep_compound_tail(struct page *tail,
> {
> tail->mapping = TAIL_MAPPING;
> set_compound_head(tail, head, order);
> - set_page_private(tail, 0);
> }
>
> static inline void init_compound_tail(struct page *tail,
>