[merged mm-stable] mm-hugetlb-remove-unused-bootmem-cma-field.patch removed from -mm tree
Andrew Morton <[email protected]> Tue, 28 Jul 2026 21:14:37 -0700
| Newsgroups | org.kernel.vger.mm-commits |
|---|---|
| Message-ID | <[email protected]> |
The quilt patch titled
Subject: mm/hugetlb: remove unused bootmem cma field
has been removed from the -mm tree. Its filename was
mm-hugetlb-remove-unused-bootmem-cma-field.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: Muchun Song <[email protected]>
Subject: mm/hugetlb: remove unused bootmem cma field
Date: Fri, 12 Jun 2026 11:59:02 +0800
struct huge_bootmem_page no longer needs to keep the CMA pointer. The
bootmem path only needs to remember whether a huge page came from CMA,
which is already encoded in the flags field.
Set HUGE_BOOTMEM_CMA when the page is allocated, drop the unused cma field
together with the redundant assignments, and simplify the early CMA
bootmem allocation fallback path now that the cma pointer no longer has to
be stored in struct huge_bootmem_page.
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Muchun Song <[email protected]>
Cc: "Aneesh Kumar K.V" <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Frank van der Linden <[email protected]>
Cc: Liam R. Howlett <[email protected]>
Cc: Lorenzo Stoakes <[email protected]>
Cc: Madhavan Srinivasan <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Mike Rapoport (Microsoft) <[email protected]>
Cc: Nicholas Piggin <[email protected]>
Cc: Oscar Salvador <[email protected]>
Cc: Oscar Salvador (SUSE) <[email protected]>
Cc: "Ritesh Harjani (IBM)" <[email protected]>
Cc: Usama Arif <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---
mm/hugetlb.c | 5 +----
mm/hugetlb_cma.c | 29 +++++++++++------------------
mm/internal.h | 2 --
3 files changed, 12 insertions(+), 24 deletions(-)
--- a/mm/hugetlb.c~mm-hugetlb-remove-unused-bootmem-cma-field
+++ a/mm/hugetlb.c
@@ -3076,10 +3076,7 @@ static bool __init alloc_bootmem_huge_pa
*/
INIT_LIST_HEAD(&m->list);
m->hstate = h;
- if (!hugetlb_early_cma(h)) {
- m->cma = NULL;
- m->flags = 0;
- }
+ m->flags = hugetlb_early_cma(h) ? HUGE_BOOTMEM_CMA : 0;
/* CMA pages: zone-crossing is validated in hugetlb_cma_reserve(). */
if (!hugetlb_early_cma(h) &&
--- a/mm/hugetlb_cma.c~mm-hugetlb-remove-unused-bootmem-cma-field
+++ a/mm/hugetlb_cma.c
@@ -59,31 +59,24 @@ struct folio *hugetlb_cma_alloc_frozen_f
void * __init hugetlb_cma_alloc_bootmem(struct hstate *h, int nid, bool node_exact)
{
struct cma *cma;
- struct huge_bootmem_page *m;
+ void *m;
int node;
cma = hugetlb_cma[nid];
m = cma_reserve_early(cma, huge_page_size(h));
- if (!m) {
- if (node_exact)
- return NULL;
+ if (m || node_exact)
+ return m;
- for_each_node_mask(node, hugetlb_bootmem_nodes) {
- cma = hugetlb_cma[node];
- if (!cma || node == nid)
- continue;
- m = cma_reserve_early(cma, huge_page_size(h));
- if (m)
- break;
- }
+ for_each_node_mask(node, hugetlb_bootmem_nodes) {
+ cma = hugetlb_cma[node];
+ if (!cma || node == nid)
+ continue;
+ m = cma_reserve_early(cma, huge_page_size(h));
+ if (m)
+ return m;
}
- if (m) {
- m->flags = HUGE_BOOTMEM_CMA;
- m->cma = cma;
- }
-
- return m;
+ return NULL;
}
static int __init cmdline_parse_hugetlb_cma(char *p)
--- a/mm/internal.h~mm-hugetlb-remove-unused-bootmem-cma-field
+++ a/mm/internal.h
@@ -24,13 +24,11 @@
struct folio_batch;
struct hstate;
-struct cma;
struct huge_bootmem_page {
struct list_head list;
struct hstate *hstate;
unsigned long flags;
- struct cma *cma;
};
/*
_
Patches currently in -mm which might be from [email protected] are
selftests-mm-remove-obsolete-hugetlb-vmemmap-test.patch