mirror of
https://github.com/torvalds/linux.git
synced 2025-12-01 15:35:58 +07:00
mm: remove call to hugetlb_free_pgd_range()
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. Link: https://lkml.kernel.org/r/20250716012611.10369-3-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: 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>
This commit is contained in:
committed by
Andrew Morton
parent
d0813985a2
commit
1c7bf6c545
42
mm/memory.c
42
mm/memory.c
@@ -379,32 +379,26 @@ void free_pgtables(struct mmu_gather *tlb, struct ma_state *mas,
|
|||||||
vma_start_write(vma);
|
vma_start_write(vma);
|
||||||
unlink_anon_vmas(vma);
|
unlink_anon_vmas(vma);
|
||||||
|
|
||||||
if (is_vm_hugetlb_page(vma)) {
|
unlink_file_vma_batch_init(&vb);
|
||||||
unlink_file_vma(vma);
|
unlink_file_vma_batch_add(&vb, 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);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Optimization: gather nearby vmas into one call down
|
* Optimization: gather nearby vmas into one call down
|
||||||
*/
|
*/
|
||||||
while (next && next->vm_start <= vma->vm_end + PMD_SIZE
|
while (next && next->vm_start <= vma->vm_end + PMD_SIZE) {
|
||||||
&& !is_vm_hugetlb_page(next)) {
|
vma = next;
|
||||||
vma = next;
|
next = mas_find(mas, ceiling - 1);
|
||||||
next = mas_find(mas, ceiling - 1);
|
if (unlikely(xa_is_zero(next)))
|
||||||
if (unlikely(xa_is_zero(next)))
|
next = NULL;
|
||||||
next = NULL;
|
if (mm_wr_locked)
|
||||||
if (mm_wr_locked)
|
vma_start_write(vma);
|
||||||
vma_start_write(vma);
|
unlink_anon_vmas(vma);
|
||||||
unlink_anon_vmas(vma);
|
unlink_file_vma_batch_add(&vb, 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);
|
|
||||||
}
|
}
|
||||||
|
unlink_file_vma_batch_final(&vb);
|
||||||
|
|
||||||
|
free_pgd_range(tlb, addr, vma->vm_end,
|
||||||
|
floor, next ? next->vm_start : ceiling);
|
||||||
vma = next;
|
vma = next;
|
||||||
} while (vma);
|
} while (vma);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user