Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/hugetlb: drop hugetlb_cma_check()

hugetlb_cma_check() was required when the ordering of
hugetlb_cma_reserve() and hugetlb_bootmem_alloc() was architecture
depended.

Since hugetlb_cma_reserve() is always called before
hugetlb_bootmem_alloc() there is no need to check whether
hugetlb_cma_reserve() was already called.

Drop unneeded hugetlb_cma_check() function.

Link: https://lkml.kernel.org/r/20260111082105.290734-29-rppt@kernel.org
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Acked-by: Muchun Song <muchun.song@linux.dev>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Alex Shi <alexs@kernel.org>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: "Borislav Petkov (AMD)" <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Guo Ren <guoren@kernel.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Klara Modin <klarasmodin@gmail.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Magnus Lindholm <linmag7@gmail.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Pratyush Yadav <pratyush@kernel.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Vineet Gupta <vgupta@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Mike Rapoport (Microsoft) and committed by
Andrew Morton
7a9c0bf0 9fac145b

+3 -19
-1
mm/hugetlb.c
··· 4159 4159 } 4160 4160 } 4161 4161 4162 - hugetlb_cma_check(); 4163 4162 hugetlb_init_hstates(); 4164 4163 gather_bootmem_prealloc(); 4165 4164 report_hugepages();
+3 -13
mm/hugetlb_cma.c
··· 85 85 return m; 86 86 } 87 87 88 - 89 - static bool cma_reserve_called __initdata; 90 - 91 88 static int __init cmdline_parse_hugetlb_cma(char *p) 92 89 { 93 90 int nid, count = 0; ··· 146 149 return; 147 150 148 151 order = arch_hugetlb_cma_order(); 149 - if (!order) 152 + if (!order) { 153 + pr_warn("hugetlb_cma: the option isn't supported by current arch\n"); 150 154 return; 155 + } 151 156 152 157 /* 153 158 * HugeTLB CMA reservation is required for gigantic ··· 158 159 * breaking this assumption. 159 160 */ 160 161 VM_WARN_ON(order <= MAX_PAGE_ORDER); 161 - cma_reserve_called = true; 162 162 163 163 hugetlb_bootmem_set_nodes(); 164 164 ··· 249 251 * cma are possible. Set to zero if no cma regions are set up. 250 252 */ 251 253 hugetlb_cma_size = 0; 252 - } 253 - 254 - void __init hugetlb_cma_check(void) 255 - { 256 - if (!hugetlb_cma_size || cma_reserve_called) 257 - return; 258 - 259 - pr_warn("hugetlb_cma: the option isn't supported by current arch\n"); 260 254 } 261 255 262 256 bool hugetlb_cma_exclusive_alloc(void)
-5
mm/hugetlb_cma.h
··· 8 8 int nid, nodemask_t *nodemask); 9 9 struct huge_bootmem_page *hugetlb_cma_alloc_bootmem(struct hstate *h, int *nid, 10 10 bool node_exact); 11 - void hugetlb_cma_check(void); 12 11 bool hugetlb_cma_exclusive_alloc(void); 13 12 unsigned long hugetlb_cma_total_size(void); 14 13 void hugetlb_cma_validate_params(void); ··· 28 29 bool node_exact) 29 30 { 30 31 return NULL; 31 - } 32 - 33 - static inline void hugetlb_cma_check(void) 34 - { 35 32 } 36 33 37 34 static inline bool hugetlb_cma_exclusive_alloc(void)