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.

arm64: pgtable: use mmu gather to free p4d level page table

Like other levels of page tables, also use mmu gather mechanism to free
p4d level page table.

Link: https://lkml.kernel.org/r/3fd48525397b34a64f7c0eb76746da30814dc941.1736317725.git.zhengqi.arch@bytedance.com
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Originally-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Aneesh Kumar K.V (Arm) <aneesh.kumar@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jann Horn <jannh@google.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Cc: Will Deacon <will@kernel.org>
Cc: Yu Zhao <yuzhao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Qi Zheng and committed by
Andrew Morton
440af48d 5fcf5fa6

+14 -1
-1
arch/arm64/include/asm/pgalloc.h
··· 85 85 __pgd_populate(pgdp, __pa(p4dp), pgdval); 86 86 } 87 87 88 - #define __p4d_free_tlb(tlb, p4d, addr) p4d_free((tlb)->mm, p4d) 89 88 #else 90 89 static inline void __pgd_populate(pgd_t *pgdp, phys_addr_t p4dp, pgdval_t prot) 91 90 {
+14
arch/arm64/include/asm/tlb.h
··· 111 111 } 112 112 #endif 113 113 114 + #if CONFIG_PGTABLE_LEVELS > 4 115 + static inline void __p4d_free_tlb(struct mmu_gather *tlb, p4d_t *p4dp, 116 + unsigned long addr) 117 + { 118 + struct ptdesc *ptdesc = virt_to_ptdesc(p4dp); 119 + 120 + if (!pgtable_l5_enabled()) 121 + return; 122 + 123 + pagetable_p4d_dtor(ptdesc); 124 + tlb_remove_ptdesc(tlb, ptdesc); 125 + } 126 + #endif 127 + 114 128 #endif