Re: [PATCH 01/11] mm: Change the interface of prep_compound_tail()

Kiryl Shutsemau
2025-12-05T22:10:14Z

On Fri, Dec 05, 2025 at 09:49:36PM +0000, Usama Arif wrote:
>
>
> On 05/12/2025 19:43, Kiryl Shutsemau wrote:
> > Instead of passing down the head page and tail page index, pass the tail
> > and head pages directly, as well as the order of the compound page.
> >
> > This is a preparation for changing how the head position is encoded in
> > the tail page.
> >
> > Signed-off-by: Kiryl Shutsemau <kas@kernel.org>
> > ---
> > include/linux/page-flags.h | 4 +++-
> > mm/hugetlb.c | 8 +++++---
> > mm/internal.h | 11 +++++------
> > mm/mm_init.c | 2 +-
> > mm/page_alloc.c | 2 +-
> > 5 files changed, 15 insertions(+), 12 deletions(-)
> >
> > diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> > index 0091ad1986bf..2c1153dd7e0e 100644
> > --- a/include/linux/page-flags.h
> > +++ b/include/linux/page-flags.h
> > @@ -865,7 +865,9 @@ static inline bool folio_test_large(const struct folio *folio)
> > return folio_test_head(folio);
> > }
> >
> > -static __always_inline void set_compound_head(struct page *page, struct page *head)
> > +static __always_inline void set_compound_head(struct page *page,
> > + struct page *head,
> > + unsigned int order)
>
> I can see that order is used later, I think patch 4, but probably this patch might cause a
> build warning as order is unused? Might be good to integrate that into the later patch?

Is there warning for unused function parameters?

I think it will blow up whole kernel, no?

> Other nit is, do we want const for head here? (Its not there before, but might be good to add).

Sure, can do.

--
Kiryl Shutsemau / Kirill A. Shutemov