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.

Revert "mm/hugetlb: deal with multiple calls to hugetlb_bootmem_alloc"

This reverts commit d58b2498200724e4f8c12d71a5953da03c8c8bdf.

hugetlb_bootmem_alloc() is called only once, no need to check if it was
called already 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 always called after
hugetlb_bootmem_alloc().

Link: https://lkml.kernel.org/r/20260111082105.290734-30-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
743758cc 7a9c0bf0

-29
-6
include/linux/hugetlb.h
··· 176 176 extern struct list_head huge_boot_pages[MAX_NUMNODES]; 177 177 178 178 void hugetlb_bootmem_alloc(void); 179 - bool hugetlb_bootmem_allocated(void); 180 179 extern nodemask_t hugetlb_bootmem_nodes; 181 180 void hugetlb_bootmem_set_nodes(void); 182 181 ··· 1304 1305 1305 1306 static inline void hugetlb_bootmem_alloc(void) 1306 1307 { 1307 - } 1308 - 1309 - static inline bool hugetlb_bootmem_allocated(void) 1310 - { 1311 - return false; 1312 1308 } 1313 1309 #endif /* CONFIG_HUGETLB_PAGE */ 1314 1310
-12
mm/hugetlb.c
··· 4486 4486 } 4487 4487 } 4488 4488 4489 - static bool __hugetlb_bootmem_allocated __initdata; 4490 - 4491 - bool __init hugetlb_bootmem_allocated(void) 4492 - { 4493 - return __hugetlb_bootmem_allocated; 4494 - } 4495 - 4496 4489 void __init hugetlb_bootmem_alloc(void) 4497 4490 { 4498 4491 struct hstate *h; 4499 4492 int i; 4500 - 4501 - if (__hugetlb_bootmem_allocated) 4502 - return; 4503 4493 4504 4494 hugetlb_bootmem_set_nodes(); 4505 4495 ··· 4504 4514 if (hstate_is_gigantic(h)) 4505 4515 hugetlb_hstate_alloc_pages(h); 4506 4516 } 4507 - 4508 - __hugetlb_bootmem_allocated = true; 4509 4517 } 4510 4518 4511 4519 /*
-11
mm/hugetlb_vmemmap.c
··· 794 794 struct huge_bootmem_page *m = NULL; 795 795 void *map; 796 796 797 - /* 798 - * Noting to do if bootmem pages were not allocated 799 - * early in boot, or if HVO wasn't enabled in the 800 - * first place. 801 - */ 802 - if (!hugetlb_bootmem_allocated()) 803 - return; 804 - 805 797 if (!READ_ONCE(vmemmap_optimize_enabled)) 806 798 return; 807 799 ··· 838 846 unsigned long pfn, nr_mmap; 839 847 struct hstate *h; 840 848 void *map; 841 - 842 - if (!hugetlb_bootmem_allocated()) 843 - return; 844 849 845 850 if (!READ_ONCE(vmemmap_optimize_enabled)) 846 851 return;