[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251228124001.3624742-29-rppt@kernel.org>
Date: Sun, 28 Dec 2025 14:39:58 +0200
From: Mike Rapoport <rppt@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Alex Shi <alexs@...nel.org>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Andreas Larsson <andreas@...sler.com>,
Borislav Petkov <bp@...en8.de>,
Brian Cain <bcain@...nel.org>,
"Christophe Leroy (CS GROUP)" <chleroy@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
"David S. Miller" <davem@...emloft.net>,
Dave Hansen <dave.hansen@...ux.intel.com>,
David Hildenbrand <david@...nel.org>,
Dinh Nguyen <dinguyen@...nel.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Guo Ren <guoren@...nel.org>,
Heiko Carstens <hca@...ux.ibm.com>,
Helge Deller <deller@....de>,
Huacai Chen <chenhuacai@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
Johannes Berg <johannes@...solutions.net>,
John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
Jonathan Corbet <corbet@....net>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Magnus Lindholm <linmag7@...il.com>,
Matt Turner <mattst88@...il.com>,
Max Filippov <jcmvbkbc@...il.com>,
Michael Ellerman <mpe@...erman.id.au>,
Michal Hocko <mhocko@...e.com>,
Michal Simek <monstr@...str.eu>,
Mike Rapoport <rppt@...nel.org>,
Muchun Song <muchun.song@...ux.dev>,
Oscar Salvador <osalvador@...e.de>,
Palmer Dabbelt <palmer@...belt.com>,
Pratyush Yadav <pratyush@...nel.org>,
Richard Weinberger <richard@....at>,
Russell King <linux@...linux.org.uk>,
Stafford Horne <shorne@...il.com>,
Suren Baghdasaryan <surenb@...gle.com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Thomas Gleixner <tglx@...utronix.de>,
Vasily Gorbik <gor@...ux.ibm.com>,
Vineet Gupta <vgupta@...nel.org>,
Vlastimil Babka <vbabka@...e.cz>,
Will Deacon <will@...nel.org>,
x86@...nel.org,
linux-alpha@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-csky@...r.kernel.org,
linux-cxl@...r.kernel.org,
linux-doc@...r.kernel.org,
linux-hexagon@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-m68k@...ts.linux-m68k.org,
linux-mips@...r.kernel.org,
linux-mm@...ck.org,
linux-openrisc@...r.kernel.org,
linux-parisc@...r.kernel.org,
linux-riscv@...ts.infradead.org,
linux-s390@...r.kernel.org,
linux-sh@...r.kernel.org,
linux-snps-arc@...ts.infradead.org,
linux-um@...ts.infradead.org,
linuxppc-dev@...ts.ozlabs.org,
loongarch@...ts.linux.dev,
sparclinux@...r.kernel.org
Subject: [PATCH 28/28] Revert "mm/hugetlb: deal with multiple calls to hugetlb_bootmem_alloc"
From: "Mike Rapoport (Microsoft)" <rppt@...nel.org>
hugetlb_bootmem_alloc() is called only once, no need to check if it was
called aready at its entry.
Other checks performed during HVO initialization are also no longer
necessary because sparse_init() that calls hugetlb_vmemmap_init_early()
and hugetlb_vmemmap_init_late() is alaways called after
hugetlb_bootmem_alloc().
This reverts commit d58b2498200724e4f8c12d71a5953da03c8c8bdf.
Signed-off-by: Mike Rapoport (Microsoft) <rppt@...nel.org>
---
include/linux/hugetlb.h | 6 ------
mm/hugetlb.c | 12 ------------
mm/hugetlb_vmemmap.c | 11 -----------
3 files changed, 29 deletions(-)
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 08fc332e88a7..c8b1a6dd2d46 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -175,7 +175,6 @@ extern int sysctl_hugetlb_shm_group __read_mostly;
extern struct list_head huge_boot_pages[MAX_NUMNODES];
void hugetlb_bootmem_alloc(void);
-bool hugetlb_bootmem_allocated(void);
extern nodemask_t hugetlb_bootmem_nodes;
void hugetlb_bootmem_set_nodes(void);
@@ -1300,11 +1299,6 @@ static inline bool hugetlbfs_pagecache_present(
static inline void hugetlb_bootmem_alloc(void)
{
}
-
-static inline bool hugetlb_bootmem_allocated(void)
-{
- return false;
-}
#endif /* CONFIG_HUGETLB_PAGE */
static inline spinlock_t *huge_pte_lock(struct hstate *h,
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 82b322ae3fdc..e5a350c83d75 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -4470,21 +4470,11 @@ void __init hugetlb_bootmem_set_nodes(void)
}
}
-static bool __hugetlb_bootmem_allocated __initdata;
-
-bool __init hugetlb_bootmem_allocated(void)
-{
- return __hugetlb_bootmem_allocated;
-}
-
void __init hugetlb_bootmem_alloc(void)
{
struct hstate *h;
int i;
- if (__hugetlb_bootmem_allocated)
- return;
-
hugetlb_bootmem_set_nodes();
for (i = 0; i < MAX_NUMNODES; i++)
@@ -4498,8 +4488,6 @@ void __init hugetlb_bootmem_alloc(void)
if (hstate_is_gigantic(h))
hugetlb_hstate_alloc_pages(h);
}
-
- __hugetlb_bootmem_allocated = true;
}
/*
diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c
index 9d01f883fd71..a9280259e12a 100644
--- a/mm/hugetlb_vmemmap.c
+++ b/mm/hugetlb_vmemmap.c
@@ -794,14 +794,6 @@ void __init hugetlb_vmemmap_init_early(int nid)
struct huge_bootmem_page *m = NULL;
void *map;
- /*
- * Noting to do if bootmem pages were not allocated
- * early in boot, or if HVO wasn't enabled in the
- * first place.
- */
- if (!hugetlb_bootmem_allocated())
- return;
-
if (!READ_ONCE(vmemmap_optimize_enabled))
return;
@@ -847,9 +839,6 @@ void __init hugetlb_vmemmap_init_late(int nid)
struct hstate *h;
void *map;
- if (!hugetlb_bootmem_allocated())
- return;
-
if (!READ_ONCE(vmemmap_optimize_enabled))
return;
--
2.51.0
Powered by blists - more mailing lists