linux/arch/sparc/mm
Anthony Yznaga d0813985a2 sparc64: remove hugetlb_free_pgd_range()
Patch series "drop hugetlb_free_pgd_range()".

For all architectures that support hugetlb except for sparc,
hugetlb_free_pgd_range() just calls free_pgd_range().  It turns out the
sparc implementation is essentially identical to free_pgd_range() and can
be removed.  Remove it and update free_pgtables() to treat hugetlb VMAs
the same as others.


This patch (of 3):

The sparc implementation of hugetlb_free_pgd_range() is identical to
free_pgd_range() with the exception of checking for and skipping possible
leaf entries at the PUD and PMD levels.

These checks are unnecessary because any huge pages have been freed and
their PTEs cleared by the time page tables needed to map them are freed. 
While some huge page sizes do populate the page table with multiple PTEs,
they are correctly cleared by huge_ptep_get_and_clear().

To verify this, libhugetlbfs tests were run for 64K, 8M, and 256M page
sizes with an instrumented kernel on a qemu guest modified to support the
256M page size.  The same tests were used to verify no regressions after
applying this patch and were also run on x86 for both 2M and 1G page
sizes.

Link: https://lkml.kernel.org/r/20250716012611.10369-1-anthony.yznaga@oracle.com
Link: https://lkml.kernel.org/r/20250716012611.10369-2-anthony.yznaga@oracle.com
Signed-off-by: Anthony Yznaga <anthony.yznaga@oracle.com>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Acked-by: Oscar Salvador <osalvador@suse.de>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: David Hildenbrand <david@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-07-24 19:12:31 -07:00
..
execmem.c arch: make execmem setup available regardless of CONFIG_MODULES 2024-05-14 00:31:44 -07:00
fault_32.c sparc32: fix lock_mm_and_find_vma() conversion 2023-06-29 20:41:24 -07:00
fault_64.c Merge branch 'expand-stack' 2023-06-28 20:35:21 -07:00
hugetlbpage.c sparc64: remove hugetlb_free_pgd_range() 2025-07-24 19:12:31 -07:00
hypersparc.S
init_32.c arch, mm: make releasing of memory to page allocator more explicit 2025-03-17 22:06:53 -07:00
init_64.c mm: change vm_get_page_prot() to accept vm_flags_t argument 2025-07-09 22:42:13 -07:00
init_64.h
io-unit.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
iommu.c sparc: Explicitly include correct DT includes 2023-08-28 13:30:57 -05:00
leon_mm.c arch/sparc: remove unused varible paddrbase in function leon_swprobe() 2024-09-13 20:12:11 +02:00
Makefile arch: make execmem setup available regardless of CONFIG_MODULES 2024-05-14 00:31:44 -07:00
mm_32.h sparc32: kill lookup_fault() 2021-01-03 20:05:14 -05:00
srmmu.c mm: pass mm down to pagetable_{pte,pmd}_ctor 2025-05-11 17:48:21 -07:00
srmmu_access.S
swift.S
tlb.c sparc/mm: disable preemption in lazy mmu mode 2025-03-17 00:05:34 -07:00
tsb.c sparc: Fix typos 2024-02-16 16:50:25 +01:00
tsunami.S
ultra.S mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
viking.S