From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6610A747F for ; Thu, 9 Jan 2025 05:00:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736398847; cv=none; b=VX3Bs6dY8kvu4C1OJDZmK1h/6psiUDX1OymIGyLzCfXGZnlIGxPqLaRHiDLgmvdPHvLGhmWCEXz1ZXE3hQL0s2QbQr6BcRzG+8OPpdD1gS2D87oS2sDe3Z4GFPVpREviVDAIW7HjGJlSmF0SiNxzMfZHDEURERbQayHB6N4Agh8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736398847; c=relaxed/simple; bh=cO8aqMwmRuwokEPJD7jjR/QVj0Omsrtxwzf1zJL2nBw=; h=Date:To:From:Subject:Message-Id; b=h1iegI+Tn15D3RVx+PWFCokKY32HIuKXQkMqWIwbnoptVeTSud/wOQvvMaJ0oiVEQLGmkXLMh6CYQqaL93Qcjs+Nv7JYEIIcV3glXgsl2EK4OZNaYOvUB7HRl302MVpjFef0KssJ16tDwiJs8g2i5rlhmXrOCAwyKpTYNpV6a1k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=gWBMaSrQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="gWBMaSrQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C739DC4CED2; Thu, 9 Jan 2025 05:00:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1736398846; bh=cO8aqMwmRuwokEPJD7jjR/QVj0Omsrtxwzf1zJL2nBw=; h=Date:To:From:Subject:From; b=gWBMaSrQ+U2mQDNJ/d4UYDnCNVz+8VuiZn5jKH/SrPk6ocRsvPdo7jHF/8SYXwbbg lzvqbC5SQWTNP6anHIN1AqY/NdTF7D82WteLLdcC9ouhbSXGbEYEOfiFOY7meilUsG nmvhcV+FArbkojgS/F/CGaR+HSI/6Ng9olq59PsA= Date: Wed, 08 Jan 2025 21:00:46 -0800 To: mm-commits@vger.kernel.org,yuzhao@google.com,willy@infradead.org,will@kernel.org,vishal.moola@gmail.com,tglx@linutronix.de,ryan.roberts@arm.com,rppt@kernel.org,rientjes@google.com,peterz@infradead.org,palmer@dabbelt.com,npiggin@gmail.com,muchun.song@linux.dev,lorenzo.stoakes@oracle.com,kevin.brodsky@arm.com,jannh@google.com,hughd@google.com,david@redhat.com,dave.hansen@linux.intel.com,arnd@arndb.de,aneesh.kumar@kernel.org,andreas@gaisler.com,alexghiti@rivosinc.com,alex@ghiti.fr,agordeev@linux.ibm.com,zhengqi.arch@bytedance.com,akpm@linux-foundation.org From: Andrew Morton Subject: + arm64-pgtable-use-mmu-gather-to-free-p4d-level-page-table.patch added to mm-unstable branch Message-Id: <20250109050046.C739DC4CED2@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: arm64: pgtable: use mmu gather to free p4d level page table has been added to the -mm mm-unstable branch. Its filename is arm64-pgtable-use-mmu-gather-to-free-p4d-level-page-table.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/arm64-pgtable-use-mmu-gather-to-free-p4d-level-page-table.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Qi Zheng Subject: arm64: pgtable: use mmu gather to free p4d level page table Date: Wed, 8 Jan 2025 14:57:21 +0800 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 Originally-by: Peter Zijlstra (Intel) Reviewed-by: Kevin Brodsky Cc: Alexander Gordeev Cc: Alexandre Ghiti Cc: Alexandre Ghiti Cc: Andreas Larsson Cc: Aneesh Kumar K.V (Arm) Cc: Arnd Bergmann Cc: Dave Hansen Cc: David Hildenbrand Cc: David Rientjes Cc: Hugh Dickins Cc: Jann Horn Cc: Lorenzo Stoakes Cc: Matthew Wilcox (Oracle) Cc: Mike Rapoport (Microsoft) Cc: Muchun Song Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Ryan Roberts Cc: Thomas Gleixner Cc: Vishal Moola (Oracle) Cc: Will Deacon Cc: Yu Zhao Signed-off-by: Andrew Morton --- arch/arm64/include/asm/pgalloc.h | 1 - arch/arm64/include/asm/tlb.h | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) --- a/arch/arm64/include/asm/pgalloc.h~arm64-pgtable-use-mmu-gather-to-free-p4d-level-page-table +++ a/arch/arm64/include/asm/pgalloc.h @@ -85,7 +85,6 @@ static inline void pgd_populate(struct m __pgd_populate(pgdp, __pa(p4dp), pgdval); } -#define __p4d_free_tlb(tlb, p4d, addr) p4d_free((tlb)->mm, p4d) #else static inline void __pgd_populate(pgd_t *pgdp, phys_addr_t p4dp, pgdval_t prot) { --- a/arch/arm64/include/asm/tlb.h~arm64-pgtable-use-mmu-gather-to-free-p4d-level-page-table +++ a/arch/arm64/include/asm/tlb.h @@ -111,4 +111,18 @@ static inline void __pud_free_tlb(struct } #endif +#if CONFIG_PGTABLE_LEVELS > 4 +static inline void __p4d_free_tlb(struct mmu_gather *tlb, p4d_t *p4dp, + unsigned long addr) +{ + struct ptdesc *ptdesc = virt_to_ptdesc(p4dp); + + if (!pgtable_l5_enabled()) + return; + + pagetable_p4d_dtor(ptdesc); + tlb_remove_ptdesc(tlb, ptdesc); +} +#endif + #endif _ Patches currently in -mm which might be from zhengqi.arch@bytedance.com are mm-pgtable-make-ptep_clear-non-atomic.patch mm-khugepaged-recheck-pmd-state-in-retract_page_tables.patch mm-userfaultfd-recheck-dst_pmd-entry-in-move_pages_pte.patch mm-userfaultfd-recheck-dst_pmd-entry-in-move_pages_pte-fix.patch mm-introduce-zap_nonpresent_ptes.patch mm-introduce-do_zap_pte_range.patch mm-skip-over-all-consecutive-none-ptes-in-do_zap_pte_range.patch mm-zap_install_uffd_wp_if_needed-return-whether-uffd-wp-pte-has-been-re-installed.patch mm-do_zap_pte_range-return-any_skipped-information-to-the-caller.patch mm-make-zap_pte_range-handle-full-within-pmd-range.patch mm-pgtable-reclaim-empty-pte-page-in-madvisemadv_dontneed.patch mm-pgtable-reclaim-empty-pte-page-in-madvisemadv_dontneed-fix.patch x86-mm-free-page-table-pages-by-rcu-instead-of-semi-rcu.patch mm-pgtable-make-ptlock-be-freed-by-rcu.patch x86-select-arch_supports_pt_reclaim-if-x86_64.patch revert-mm-pgtable-make-ptlock-be-freed-by-rcu.patch mm-pgtable-add-statistics-for-p4d-level-page-table.patch arm64-pgtable-use-mmu-gather-to-free-p4d-level-page-table.patch s390-pgtable-add-statistics-for-pud-and-p4d-level-page-table.patch mm-pgtable-introduce-pagetable_dtor.patch arm-pgtable-move-pagetable_dtor-to-__tlb_remove_table.patch arm64-pgtable-move-pagetable_dtor-to-__tlb_remove_table.patch riscv-pgtable-move-pagetable_dtor-to-__tlb_remove_table.patch x86-pgtable-convert-__tlb_remove_table-to-use-struct-ptdesc.patch x86-pgtable-move-pagetable_dtor-to-__tlb_remove_table.patch s390-pgtable-consolidate-pxd-and-pte-tlb-free-paths.patch mm-pgtable-introduce-generic-__tlb_remove_table.patch mm-pgtable-completely-move-pagetable_dtor-to-generic-tlb_remove_table.patch mm-pgtable-move-__tlb_remove_table_one-in-x86-to-generic-file.patch mm-pgtable-introduce-generic-pagetable_dtor_free.patch