Re: [PATCHv6 04/17] mm: Move set/clear_compound_head() next to compound_head()
From: David Hildenbrand (arm)
Date: Wed Feb 04 2026 - 11:41:07 EST
On 2/2/26 16:56, Kiryl Shutsemau wrote:
Move set_compound_head() and clear_compound_head() to be adjacent to the
compound_head() function in page-flags.h.
These functions encode and decode the same compound_info field, so
keeping them together makes it easier to verify their logic is
consistent, especially when the encoding changes.
Signed-off-by: Kiryl Shutsemau <kas@xxxxxxxxxx>
Reviewed-by: Muchun Song <muchun.song@xxxxxxxxx>
Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>
---
include/linux/page-flags.h | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index aa46d49e82f7..d14a17ffb55b 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -290,6 +290,18 @@ static __always_inline unsigned long _compound_head(const struct page *page)
#define compound_head(page) ((typeof(page))_compound_head(page))
+static __always_inline void set_compound_head(struct page *page,
+ const struct page *head,
+ unsigned int order)
^ :)
Acked-by: David Hildenbrand (arm) <david@xxxxxxxxxx>
--
Cheers,
David