* [merged mm-stable] mm-change-the-interface-of-prep_compound_tail.patch removed from -mm tree
@ 2026-03-24 21:43 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-03-24 21:43 UTC (permalink / raw)
To: mm-commits, ziy, willy, vbabka, usamaarif642, rppt,
roman.gushchin, rientjes, paul.walmsley, palmer, osalvador,
muchun.song, mhocko, lorenzo.stoakes, kernel, harry.yoo, hannes,
fvdl, david, corbet, cl, chenhuacai, bhe, aou, alex, kas, akpm
The quilt patch titled
Subject: mm: change the interface of prep_compound_tail()
has been removed from the -mm tree. Its filename was
mm-change-the-interface-of-prep_compound_tail.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Kiryl Shutsemau <kas@kernel.org>
Subject: mm: change the interface of prep_compound_tail()
Date: Fri, 27 Feb 2026 19:42:40 +0000
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.
Link: https://lkml.kernel.org/r/20260227194302.274384-3-kas@kernel.org
Signed-off-by: Kiryl Shutsemau <kas@kernel.org>
Reviewed-by: Muchun Song <muchun.song@linux.dev>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Acked-by: David Hildenbrand (arm) <david@kernel.org>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Baoquan He <bhe@redhat.com>
Cc: Christoph Lameter <cl@gentwo.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Frank van der Linden <fvdl@google.com>
Cc: Harry Yoo <harry.yoo@oracle.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Usama Arif <usamaarif642@gmail.com>
Cc: WANG Xuerui <kernel@xen0n.name>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/page-flags.h | 5 +++--
mm/hugetlb.c | 8 +++++---
mm/internal.h | 11 +++++------
mm/mm_init.c | 2 +-
mm/page_alloc.c | 2 +-
5 files changed, 15 insertions(+), 13 deletions(-)
--- a/include/linux/page-flags.h~mm-change-the-interface-of-prep_compound_tail
+++ a/include/linux/page-flags.h
@@ -870,9 +870,10 @@ static inline bool folio_test_large(cons
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 *tail,
+ const struct page *head, unsigned int order)
{
- WRITE_ONCE(page->compound_head, (unsigned long)head + 1);
+ WRITE_ONCE(tail->compound_head, (unsigned long)head + 1);
}
static __always_inline void clear_compound_head(struct page *page)
--- a/mm/hugetlb.c~mm-change-the-interface-of-prep_compound_tail
+++ a/mm/hugetlb.c
@@ -3168,6 +3168,7 @@ found:
/* Initialize [start_page:end_page_number] tail struct pages of a hugepage */
static void __init hugetlb_folio_init_tail_vmemmap(struct folio *folio,
+ struct hstate *h,
unsigned long start_page_number,
unsigned long end_page_number)
{
@@ -3176,6 +3177,7 @@ static void __init hugetlb_folio_init_ta
struct page *page = folio_page(folio, start_page_number);
unsigned long head_pfn = folio_pfn(folio);
unsigned long pfn, end_pfn = head_pfn + end_page_number;
+ unsigned int order = huge_page_order(h);
/*
* As we marked all tail pages with memblock_reserved_mark_noinit(),
@@ -3183,7 +3185,7 @@ static void __init hugetlb_folio_init_ta
*/
for (pfn = head_pfn + start_page_number; pfn < end_pfn; page++, pfn++) {
__init_single_page(page, pfn, zone, nid);
- prep_compound_tail((struct page *)folio, pfn - head_pfn);
+ prep_compound_tail(page, &folio->page, order);
set_page_count(page, 0);
}
}
@@ -3203,7 +3205,7 @@ static void __init hugetlb_folio_init_vm
__folio_set_head(folio);
ret = folio_ref_freeze(folio, 1);
VM_BUG_ON(!ret);
- hugetlb_folio_init_tail_vmemmap(folio, 1, nr_pages);
+ hugetlb_folio_init_tail_vmemmap(folio, h, 1, nr_pages);
prep_compound_head(&folio->page, huge_page_order(h));
}
@@ -3260,7 +3262,7 @@ static void __init prep_and_add_bootmem_
* time as this is early in boot and there should
* be no contention.
*/
- hugetlb_folio_init_tail_vmemmap(folio,
+ hugetlb_folio_init_tail_vmemmap(folio, h,
HUGETLB_VMEMMAP_RESERVE_PAGES,
pages_per_huge_page(h));
}
--- a/mm/internal.h~mm-change-the-interface-of-prep_compound_tail
+++ a/mm/internal.h
@@ -897,13 +897,12 @@ static inline void prep_compound_head(st
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,
+ const struct page *head, unsigned int order)
{
- 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);
}
void post_alloc_hook(struct page *page, unsigned int order, gfp_t gfp_flags);
--- a/mm/mm_init.c~mm-change-the-interface-of-prep_compound_tail
+++ a/mm/mm_init.c
@@ -1110,7 +1110,7 @@ static void __ref memmap_init_compound(s
struct page *page = pfn_to_page(pfn);
__init_zone_device_page(page, pfn, zone_idx, nid, pgmap);
- prep_compound_tail(head, pfn - head_pfn);
+ prep_compound_tail(page, head, order);
set_page_count(page, 0);
}
prep_compound_head(head, order);
--- a/mm/page_alloc.c~mm-change-the-interface-of-prep_compound_tail
+++ a/mm/page_alloc.c
@@ -744,7 +744,7 @@ void prep_compound_page(struct page *pag
__SetPageHead(page);
for (i = 1; i < nr_pages; i++)
- prep_compound_tail(page, i);
+ prep_compound_tail(page + i, page, order);
prep_compound_head(page, order);
}
_
Patches currently in -mm which might be from kas@kernel.org are
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-03-24 21:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-24 21:43 [merged mm-stable] mm-change-the-interface-of-prep_compound_tail.patch removed from -mm tree Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.