lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a61bc0a8-cf5a-418a-aeb4-96553b87f043@kernel.org>
Date: Wed, 4 Feb 2026 17:14:12 +0100
From: "David Hildenbrand (arm)" <david@...nel.org>
To: Kiryl Shutsemau <kas@...nel.org>,
 Andrew Morton <akpm@...ux-foundation.org>,
 Muchun Song <muchun.song@...ux.dev>, David Hildenbrand <david@...hat.com>,
 Matthew Wilcox <willy@...radead.org>, Usama Arif <usamaarif642@...il.com>,
 Frank van der Linden <fvdl@...gle.com>
Cc: Oscar Salvador <osalvador@...e.de>, Mike Rapoport <rppt@...nel.org>,
 Vlastimil Babka <vbabka@...e.cz>,
 Lorenzo Stoakes <lorenzo.stoakes@...cle.com>, Zi Yan <ziy@...dia.com>,
 Baoquan He <bhe@...hat.com>, Michal Hocko <mhocko@...e.com>,
 Johannes Weiner <hannes@...xchg.org>, Jonathan Corbet <corbet@....net>,
 Huacai Chen <chenhuacai@...nel.org>, WANG Xuerui <kernel@...0n.name>,
 Palmer Dabbelt <palmer@...belt.com>, Paul Walmsley
 <paul.walmsley@...ive.com>, Albert Ou <aou@...s.berkeley.edu>,
 Alexandre Ghiti <alex@...ti.fr>, kernel-team@...a.com, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
 loongarch@...ts.linux.dev, linux-riscv@...ts.infradead.org
Subject: Re: [PATCHv6 02/17] mm: Change the interface of prep_compound_tail()

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@...nel.org>
> Reviewed-by: Muchun Song <muchun.song@...ux.dev>
> Reviewed-by: Zi Yan <ziy@...dia.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.

>   {
>   	WRITE_ONCE(page->compound_head, (unsigned long)head + 1);
>   }
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 6e855a32de3d..54ba7cd05a86 100644


[...]

> diff --git a/mm/internal.h b/mm/internal.h
> index d67e8bb75734..037ddcda25ff 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -879,13 +879,13 @@ static inline void prep_compound_head(struct page *page, unsigned int order)
>   		INIT_LIST_HEAD(&folio->_deferred_list);
>   }
>   
> -static inline void prep_compound_tail(struct page *head, int tail_idx)
> +static inline void prep_compound_tail(struct page *tail,

Just wondering whether we should call this "struct page *page" for 
consistency with set_compound_head().

Or alternatively, call it also "tail" in set_compound_head().

> +				      const struct page *head,
> +				      unsigned int order)

Two tab indent, then this fits into two lines in total.

>   {
> -	struct page *p = head + tail_idx;
> -
> -	p->mapping = TAIL_MAPPING;
> -	set_compound_head(p, head);
> -	set_page_private(p, 0);
> +	tail->mapping = TAIL_MAPPING;
> +	set_compound_head(tail, head, order);
> +	set_page_private(tail, 0);
>   }
Only nits, in general LGTM

Acked-by: David Hildenbrand (arm) <david@...nel.org>

-- 
Cheers,

David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ