Re: [PATCHv6 02/17] mm: Change the interface of prep_compound_tail()

David Hildenbrand (arm)
2026-02-05T11:58:46Z

On 2/5/26 12:35, Kiryl Shutsemau wrote:
> On Wed, Feb 04, 2026 at 05:14:12PM +0100, David Hildenbrand (arm) wrote:
>> On 2/2/26 16:56, 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>
>>> Reviewed-by: Muchun Song <muchun.song@linux.dev>
>>> Reviewed-by: Zi Yan <ziy@nvidia.com>
>>> ---
>>> include/linux/page-flags.h | 4 +++-
>>> mm/hugetlb.c | 8 +++++---
>>> mm/internal.h | 12 ++++++------
>>> mm/mm_init.c | 2 +-
>>> mm/page_alloc.c | 2 +-
>>> 5 files changed, 16 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
>>> index f7a0e4af0c73..8a3694369e15 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,
>>> + const struct page *head,
>>> + unsigned int order)
>>
>> Two tab indents please on second+ parameter list whenever you touch code.
>
> Do we have this coding style preference written down somewhere?

Good question. I assume not. But it's what we do in MM :)

>
> -tip tree wants the opposite. Documentation/process/maintainer-tip.rst:
>
> When splitting function declarations or function calls, then please align
> the first argument in the second line with the first argument in the first
> line::
>
> I want the editor to do The Right Thing™ without my brain involvement.
> Having different coding styles in different corners of the kernel makes
> it hard.

Yeah, but unavoidable. :)

--
Cheers,

David