linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] drop hugetlb_free_pgd_range()
@ 2025-07-16  1:26 Anthony Yznaga
  2025-07-16  1:26 ` [PATCH 1/3] sparc64: remove hugetlb_free_pgd_range() Anthony Yznaga
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Anthony Yznaga @ 2025-07-16  1:26 UTC (permalink / raw)
  To: davem, andreas, arnd, muchun.song, osalvador, akpm, david,
	lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb, mhocko
  Cc: linux-mm, sparclinux, linux-arch, linux-kernel, alexghiti,
	agordeev, anshuman.khandual, christophe.leroy, ryan.roberts, will

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.

Anthony Yznaga (3):
  sparc64: remove hugetlb_free_pgd_range()
  mm: remove call to hugetlb_free_pgd_range()
  mm: drop hugetlb_free_pgd_range()

 arch/sparc/include/asm/hugetlb.h |   5 --
 arch/sparc/mm/hugetlbpage.c      | 119 -------------------------------
 include/asm-generic/hugetlb.h    |   9 ---
 include/linux/hugetlb.h          |   7 --
 mm/memory.c                      |  42 +++++------
 5 files changed, 18 insertions(+), 164 deletions(-)

-- 
2.47.1



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/3] sparc64: remove hugetlb_free_pgd_range()
  2025-07-16  1:26 [PATCH 0/3] drop hugetlb_free_pgd_range() Anthony Yznaga
@ 2025-07-16  1:26 ` Anthony Yznaga
  2025-07-16  8:20   ` David Hildenbrand
  2025-07-16  1:26 ` [PATCH 2/3] mm: remove call to hugetlb_free_pgd_range() Anthony Yznaga
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Anthony Yznaga @ 2025-07-16  1:26 UTC (permalink / raw)
  To: davem, andreas, arnd, muchun.song, osalvador, akpm, david,
	lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb, mhocko
  Cc: linux-mm, sparclinux, linux-arch, linux-kernel, alexghiti,
	agordeev, anshuman.khandual, christophe.leroy, ryan.roberts, will

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.

Signed-off-by: Anthony Yznaga <anthony.yznaga@oracle.com>
---
 arch/sparc/include/asm/hugetlb.h |   5 --
 arch/sparc/mm/hugetlbpage.c      | 119 -------------------------------
 2 files changed, 124 deletions(-)

diff --git a/arch/sparc/include/asm/hugetlb.h b/arch/sparc/include/asm/hugetlb.h
index e7a9cdd498dc..d3bc16fbcbbd 100644
--- a/arch/sparc/include/asm/hugetlb.h
+++ b/arch/sparc/include/asm/hugetlb.h
@@ -50,11 +50,6 @@ static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
 	return changed;
 }
 
-#define __HAVE_ARCH_HUGETLB_FREE_PGD_RANGE
-void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
-			    unsigned long end, unsigned long floor,
-			    unsigned long ceiling);
-
 #include <asm-generic/hugetlb.h>
 
 #endif /* _ASM_SPARC64_HUGETLB_H */
diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c
index 2048b5c42ca8..4652e868663b 100644
--- a/arch/sparc/mm/hugetlbpage.c
+++ b/arch/sparc/mm/hugetlbpage.c
@@ -315,122 +315,3 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
 
 	return entry;
 }
-
-static void hugetlb_free_pte_range(struct mmu_gather *tlb, pmd_t *pmd,
-			   unsigned long addr)
-{
-	pgtable_t token = pmd_pgtable(*pmd);
-
-	pmd_clear(pmd);
-	pte_free_tlb(tlb, token, addr);
-	mm_dec_nr_ptes(tlb->mm);
-}
-
-static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
-				   unsigned long addr, unsigned long end,
-				   unsigned long floor, unsigned long ceiling)
-{
-	pmd_t *pmd;
-	unsigned long next;
-	unsigned long start;
-
-	start = addr;
-	pmd = pmd_offset(pud, addr);
-	do {
-		next = pmd_addr_end(addr, end);
-		if (pmd_none(*pmd))
-			continue;
-		if (is_hugetlb_pmd(*pmd))
-			pmd_clear(pmd);
-		else
-			hugetlb_free_pte_range(tlb, pmd, addr);
-	} while (pmd++, addr = next, addr != end);
-
-	start &= PUD_MASK;
-	if (start < floor)
-		return;
-	if (ceiling) {
-		ceiling &= PUD_MASK;
-		if (!ceiling)
-			return;
-	}
-	if (end - 1 > ceiling - 1)
-		return;
-
-	pmd = pmd_offset(pud, start);
-	pud_clear(pud);
-	pmd_free_tlb(tlb, pmd, start);
-	mm_dec_nr_pmds(tlb->mm);
-}
-
-static void hugetlb_free_pud_range(struct mmu_gather *tlb, p4d_t *p4d,
-				   unsigned long addr, unsigned long end,
-				   unsigned long floor, unsigned long ceiling)
-{
-	pud_t *pud;
-	unsigned long next;
-	unsigned long start;
-
-	start = addr;
-	pud = pud_offset(p4d, addr);
-	do {
-		next = pud_addr_end(addr, end);
-		if (pud_none_or_clear_bad(pud))
-			continue;
-		if (is_hugetlb_pud(*pud))
-			pud_clear(pud);
-		else
-			hugetlb_free_pmd_range(tlb, pud, addr, next, floor,
-					       ceiling);
-	} while (pud++, addr = next, addr != end);
-
-	start &= PGDIR_MASK;
-	if (start < floor)
-		return;
-	if (ceiling) {
-		ceiling &= PGDIR_MASK;
-		if (!ceiling)
-			return;
-	}
-	if (end - 1 > ceiling - 1)
-		return;
-
-	pud = pud_offset(p4d, start);
-	p4d_clear(p4d);
-	pud_free_tlb(tlb, pud, start);
-	mm_dec_nr_puds(tlb->mm);
-}
-
-void hugetlb_free_pgd_range(struct mmu_gather *tlb,
-			    unsigned long addr, unsigned long end,
-			    unsigned long floor, unsigned long ceiling)
-{
-	pgd_t *pgd;
-	p4d_t *p4d;
-	unsigned long next;
-
-	addr &= PMD_MASK;
-	if (addr < floor) {
-		addr += PMD_SIZE;
-		if (!addr)
-			return;
-	}
-	if (ceiling) {
-		ceiling &= PMD_MASK;
-		if (!ceiling)
-			return;
-	}
-	if (end - 1 > ceiling - 1)
-		end -= PMD_SIZE;
-	if (addr > end - 1)
-		return;
-
-	pgd = pgd_offset(tlb->mm, addr);
-	p4d = p4d_offset(pgd, addr);
-	do {
-		next = p4d_addr_end(addr, end);
-		if (p4d_none_or_clear_bad(p4d))
-			continue;
-		hugetlb_free_pud_range(tlb, p4d, addr, next, floor, ceiling);
-	} while (p4d++, addr = next, addr != end);
-}
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/3] mm: remove call to hugetlb_free_pgd_range()
  2025-07-16  1:26 [PATCH 0/3] drop hugetlb_free_pgd_range() Anthony Yznaga
  2025-07-16  1:26 ` [PATCH 1/3] sparc64: remove hugetlb_free_pgd_range() Anthony Yznaga
@ 2025-07-16  1:26 ` Anthony Yznaga
  2025-07-16  1:26 ` [PATCH 3/3] mm: drop hugetlb_free_pgd_range() Anthony Yznaga
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Anthony Yznaga @ 2025-07-16  1:26 UTC (permalink / raw)
  To: davem, andreas, arnd, muchun.song, osalvador, akpm, david,
	lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb, mhocko
  Cc: linux-mm, sparclinux, linux-arch, linux-kernel, alexghiti,
	agordeev, anshuman.khandual, christophe.leroy, ryan.roberts, will

With the removal of the last arch-specific implementation of
hugetlb_free_pgd_range(), hugetlb VMAs no longer need special
handling when freeing page tables.

Signed-off-by: Anthony Yznaga <anthony.yznaga@oracle.com>
---
 mm/memory.c | 42 ++++++++++++++++++------------------------
 1 file changed, 18 insertions(+), 24 deletions(-)

diff --git a/mm/memory.c b/mm/memory.c
index b0cda5aab398..49792af5b7d0 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -380,32 +380,26 @@ void free_pgtables(struct mmu_gather *tlb, struct ma_state *mas,
 			vma_start_write(vma);
 		unlink_anon_vmas(vma);
 
-		if (is_vm_hugetlb_page(vma)) {
-			unlink_file_vma(vma);
-			hugetlb_free_pgd_range(tlb, addr, vma->vm_end,
-				floor, next ? next->vm_start : ceiling);
-		} else {
-			unlink_file_vma_batch_init(&vb);
-			unlink_file_vma_batch_add(&vb, vma);
+		unlink_file_vma_batch_init(&vb);
+		unlink_file_vma_batch_add(&vb, vma);
 
-			/*
-			 * Optimization: gather nearby vmas into one call down
-			 */
-			while (next && next->vm_start <= vma->vm_end + PMD_SIZE
-			       && !is_vm_hugetlb_page(next)) {
-				vma = next;
-				next = mas_find(mas, ceiling - 1);
-				if (unlikely(xa_is_zero(next)))
-					next = NULL;
-				if (mm_wr_locked)
-					vma_start_write(vma);
-				unlink_anon_vmas(vma);
-				unlink_file_vma_batch_add(&vb, vma);
-			}
-			unlink_file_vma_batch_final(&vb);
-			free_pgd_range(tlb, addr, vma->vm_end,
-				floor, next ? next->vm_start : ceiling);
+		/*
+		 * Optimization: gather nearby vmas into one call down
+		 */
+		while (next && next->vm_start <= vma->vm_end + PMD_SIZE) {
+			vma = next;
+			next = mas_find(mas, ceiling - 1);
+			if (unlikely(xa_is_zero(next)))
+				next = NULL;
+			if (mm_wr_locked)
+				vma_start_write(vma);
+			unlink_anon_vmas(vma);
+			unlink_file_vma_batch_add(&vb, vma);
 		}
+		unlink_file_vma_batch_final(&vb);
+
+		free_pgd_range(tlb, addr, vma->vm_end,
+			floor, next ? next->vm_start : ceiling);
 		vma = next;
 	} while (vma);
 }
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/3] mm: drop hugetlb_free_pgd_range()
  2025-07-16  1:26 [PATCH 0/3] drop hugetlb_free_pgd_range() Anthony Yznaga
  2025-07-16  1:26 ` [PATCH 1/3] sparc64: remove hugetlb_free_pgd_range() Anthony Yznaga
  2025-07-16  1:26 ` [PATCH 2/3] mm: remove call to hugetlb_free_pgd_range() Anthony Yznaga
@ 2025-07-16  1:26 ` Anthony Yznaga
  2025-07-16  6:36 ` [PATCH 0/3] " Mike Rapoport
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Anthony Yznaga @ 2025-07-16  1:26 UTC (permalink / raw)
  To: davem, andreas, arnd, muchun.song, osalvador, akpm, david,
	lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb, mhocko
  Cc: linux-mm, sparclinux, linux-arch, linux-kernel, alexghiti,
	agordeev, anshuman.khandual, christophe.leroy, ryan.roberts, will

There are no longer any callers of hugetlb_free_pgd_range().

Signed-off-by: Anthony Yznaga <anthony.yznaga@oracle.com>
---
 include/asm-generic/hugetlb.h | 9 ---------
 include/linux/hugetlb.h       | 7 -------
 2 files changed, 16 deletions(-)

diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
index 3e0a8fe9b108..2558daea1a32 100644
--- a/include/asm-generic/hugetlb.h
+++ b/include/asm-generic/hugetlb.h
@@ -66,15 +66,6 @@ static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
 }
 #endif
 
-#ifndef __HAVE_ARCH_HUGETLB_FREE_PGD_RANGE
-static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
-		unsigned long addr, unsigned long end,
-		unsigned long floor, unsigned long ceiling)
-{
-	free_pgd_range(tlb, addr, end, floor, ceiling);
-}
-#endif
-
 #ifndef __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT
 static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
 		pte_t *ptep, pte_t pte, unsigned long sz)
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 42f374e828a2..adf59868e5ba 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -396,13 +396,6 @@ static inline int is_hugepage_only_range(struct mm_struct *mm,
 	return 0;
 }
 
-static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
-				unsigned long addr, unsigned long end,
-				unsigned long floor, unsigned long ceiling)
-{
-	BUG();
-}
-
 #ifdef CONFIG_USERFAULTFD
 static inline int hugetlb_mfill_atomic_pte(pte_t *dst_pte,
 					   struct vm_area_struct *dst_vma,
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/3] drop hugetlb_free_pgd_range()
  2025-07-16  1:26 [PATCH 0/3] drop hugetlb_free_pgd_range() Anthony Yznaga
                   ` (2 preceding siblings ...)
  2025-07-16  1:26 ` [PATCH 3/3] mm: drop hugetlb_free_pgd_range() Anthony Yznaga
@ 2025-07-16  6:36 ` Mike Rapoport
  2025-07-16  8:05 ` Oscar Salvador
  2025-07-25  7:50 ` John Paul Adrian Glaubitz
  5 siblings, 0 replies; 10+ messages in thread
From: Mike Rapoport @ 2025-07-16  6:36 UTC (permalink / raw)
  To: Anthony Yznaga
  Cc: davem, andreas, arnd, muchun.song, osalvador, akpm, david,
	lorenzo.stoakes, Liam.Howlett, vbabka, surenb, mhocko, linux-mm,
	sparclinux, linux-arch, linux-kernel, alexghiti, agordeev,
	anshuman.khandual, christophe.leroy, ryan.roberts, will

On Tue, Jul 15, 2025 at 06:26:08PM -0700, Anthony Yznaga wrote:
> 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.
> 
> Anthony Yznaga (3):
>   sparc64: remove hugetlb_free_pgd_range()
>   mm: remove call to hugetlb_free_pgd_range()
>   mm: drop hugetlb_free_pgd_range()

Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>

>  arch/sparc/include/asm/hugetlb.h |   5 --
>  arch/sparc/mm/hugetlbpage.c      | 119 -------------------------------
>  include/asm-generic/hugetlb.h    |   9 ---
>  include/linux/hugetlb.h          |   7 --
>  mm/memory.c                      |  42 +++++------
>  5 files changed, 18 insertions(+), 164 deletions(-)
> 
> -- 
> 2.47.1
> 

-- 
Sincerely yours,
Mike.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/3] drop hugetlb_free_pgd_range()
  2025-07-16  1:26 [PATCH 0/3] drop hugetlb_free_pgd_range() Anthony Yznaga
                   ` (3 preceding siblings ...)
  2025-07-16  6:36 ` [PATCH 0/3] " Mike Rapoport
@ 2025-07-16  8:05 ` Oscar Salvador
  2025-07-16  8:16   ` Oscar Salvador
  2025-07-25  7:50 ` John Paul Adrian Glaubitz
  5 siblings, 1 reply; 10+ messages in thread
From: Oscar Salvador @ 2025-07-16  8:05 UTC (permalink / raw)
  To: Anthony Yznaga
  Cc: davem, andreas, arnd, muchun.song, akpm, david, lorenzo.stoakes,
	Liam.Howlett, vbabka, rppt, surenb, mhocko, linux-mm, sparclinux,
	linux-arch, linux-kernel, alexghiti, agordeev, anshuman.khandual,
	christophe.leroy, ryan.roberts, will

On Tue, Jul 15, 2025 at 06:26:08PM -0700, Anthony Yznaga wrote:
> 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.
> 
> Anthony Yznaga (3):
>   sparc64: remove hugetlb_free_pgd_range()
>   mm: remove call to hugetlb_free_pgd_range()
>   mm: drop hugetlb_free_pgd_range()

Acked-by: Oscar Salvador <osalvador@sude.de>

Thanks!

 

-- 
Oscar Salvador
SUSE Labs


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/3] drop hugetlb_free_pgd_range()
  2025-07-16  8:05 ` Oscar Salvador
@ 2025-07-16  8:16   ` Oscar Salvador
  0 siblings, 0 replies; 10+ messages in thread
From: Oscar Salvador @ 2025-07-16  8:16 UTC (permalink / raw)
  To: Anthony Yznaga
  Cc: davem, andreas, arnd, muchun.song, akpm, david, lorenzo.stoakes,
	Liam.Howlett, vbabka, rppt, surenb, mhocko, linux-mm, sparclinux,
	linux-arch, linux-kernel, alexghiti, agordeev, anshuman.khandual,
	christophe.leroy, ryan.roberts, will

On Wed, Jul 16, 2025 at 10:05:53AM +0200, Oscar Salvador wrote:
> Acked-by: Oscar Salvador <osalvador@sude.de>

Fat fingers, sorry:

Acked-by: Oscar Salvador <osalvador@suse.de>

 

-- 
Oscar Salvador
SUSE Labs


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] sparc64: remove hugetlb_free_pgd_range()
  2025-07-16  1:26 ` [PATCH 1/3] sparc64: remove hugetlb_free_pgd_range() Anthony Yznaga
@ 2025-07-16  8:20   ` David Hildenbrand
  2025-07-16 16:42     ` Anthony Yznaga
  0 siblings, 1 reply; 10+ messages in thread
From: David Hildenbrand @ 2025-07-16  8:20 UTC (permalink / raw)
  To: Anthony Yznaga, davem, andreas, arnd, muchun.song, osalvador,
	akpm, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb, mhocko
  Cc: linux-mm, sparclinux, linux-arch, linux-kernel, alexghiti,
	agordeev, anshuman.khandual, christophe.leroy, ryan.roberts, will

On 16.07.25 03:26, Anthony Yznaga wrote:
> 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.

And the pgd loop was optimized out, because probably not applicable.

> 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.

Do we know why that handling was added in the first place, and why it no 
longer applies?

These is_hugetlb_pmd/is_hugetlb_pud are rather weird on the code path.

Looks like a very nice cleanup.

-- 
Cheers,

David / dhildenb



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/3] sparc64: remove hugetlb_free_pgd_range()
  2025-07-16  8:20   ` David Hildenbrand
@ 2025-07-16 16:42     ` Anthony Yznaga
  0 siblings, 0 replies; 10+ messages in thread
From: Anthony Yznaga @ 2025-07-16 16:42 UTC (permalink / raw)
  To: David Hildenbrand, davem, andreas, arnd, muchun.song, osalvador,
	akpm, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb, mhocko
  Cc: linux-mm, sparclinux, linux-arch, linux-kernel, alexghiti,
	agordeev, anshuman.khandual, christophe.leroy, ryan.roberts, will



On 7/16/25 1:20 AM, David Hildenbrand wrote:
> On 16.07.25 03:26, Anthony Yznaga wrote:
>> 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.
> 
> And the pgd loop was optimized out, because probably not applicable.
> 
>> 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.
> 
> Do we know why that handling was added in the first place, and why it no 
> longer applies?

The PMD handling was added by 7bc3777ca19c (sparc64: Trim page tables 
for 8M hugepages). The only clue is that the commit message has the 
sentence, "Also, when freeing page table for 8M hugepage backed region, 
make sure we don't try to access non-existent PTE level." I'd guess that 
it was something left over from development that snuck in. The patch is 
changing from storing 1024 PTEs at the PTE level for an 8M hugetlb page 
to storing a single PMD entry.

> 
> These is_hugetlb_pmd/is_hugetlb_pud are rather weird on the code path.
> 
> Looks like a very nice cleanup.
> 



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/3] drop hugetlb_free_pgd_range()
  2025-07-16  1:26 [PATCH 0/3] drop hugetlb_free_pgd_range() Anthony Yznaga
                   ` (4 preceding siblings ...)
  2025-07-16  8:05 ` Oscar Salvador
@ 2025-07-25  7:50 ` John Paul Adrian Glaubitz
  5 siblings, 0 replies; 10+ messages in thread
From: John Paul Adrian Glaubitz @ 2025-07-25  7:50 UTC (permalink / raw)
  To: Anthony Yznaga, davem, andreas, arnd, muchun.song, osalvador,
	akpm, david, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb,
	mhocko
  Cc: linux-mm, sparclinux, linux-arch, linux-kernel, alexghiti,
	agordeev, anshuman.khandual, christophe.leroy, ryan.roberts, will

Hi Anthony,

On Tue, 2025-07-15 at 18:26 -0700, Anthony Yznaga wrote:
> 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.
> 
> Anthony Yznaga (3):
>   sparc64: remove hugetlb_free_pgd_range()
>   mm: remove call to hugetlb_free_pgd_range()
>   mm: drop hugetlb_free_pgd_range()
> 
>  arch/sparc/include/asm/hugetlb.h |   5 --
>  arch/sparc/mm/hugetlbpage.c      | 119 -------------------------------
>  include/asm-generic/hugetlb.h    |   9 ---
>  include/linux/hugetlb.h          |   7 --
>  mm/memory.c                      |  42 +++++------
>  5 files changed, 18 insertions(+), 164 deletions(-)

I have applied this series against v6.16-rc7 and booted the kernel inside a
SPARC LDOM on Solaris 11.4 without any problems.

Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-07-25  7:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16  1:26 [PATCH 0/3] drop hugetlb_free_pgd_range() Anthony Yznaga
2025-07-16  1:26 ` [PATCH 1/3] sparc64: remove hugetlb_free_pgd_range() Anthony Yznaga
2025-07-16  8:20   ` David Hildenbrand
2025-07-16 16:42     ` Anthony Yznaga
2025-07-16  1:26 ` [PATCH 2/3] mm: remove call to hugetlb_free_pgd_range() Anthony Yznaga
2025-07-16  1:26 ` [PATCH 3/3] mm: drop hugetlb_free_pgd_range() Anthony Yznaga
2025-07-16  6:36 ` [PATCH 0/3] " Mike Rapoport
2025-07-16  8:05 ` Oscar Salvador
2025-07-16  8:16   ` Oscar Salvador
2025-07-25  7:50 ` John Paul Adrian Glaubitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).