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 C121F3FE4 for ; Tue, 24 Dec 2024 00:45:03 +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=1735001103; cv=none; b=nhqUZGz8h+9fzroVd6e/dAkz96F/WPlh/6H0wptr4OtaF7tpPNhpnGR27HHorlH8wyIZCPaEA45K01Jc1J2JEhWGTBp8qhs1xxOZ9JZo8mK4OnCO//jzxD1/89bUp99H59xrShfkvdANwN2fNqFbiQTBwOUosA6nOxNZRzBf5F4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735001103; c=relaxed/simple; bh=q2DvfXB6mp/rZNAB6fGgZ/sr/6vxwpon96cvm0VmjSo=; h=Date:To:From:Subject:Message-Id; b=MXdMDU1AZE5d0r9pBXQmWQsk23PIP5je61gnrVfvEbME+pHvMae2lPXJv4EjuiHQKZjwwC/0Ne36CJpXviJkodpxqfU09KErHpyjoyPFqX0Ud7cj79wLWcwP0V6jB5cc9mW8qeZxq+/WY8Zr+ulCTyHnPQD5R1boH2xrcmr9wTQ= 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=v698peU7; 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="v698peU7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4239FC4CED3; Tue, 24 Dec 2024 00:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1735001103; bh=q2DvfXB6mp/rZNAB6fGgZ/sr/6vxwpon96cvm0VmjSo=; h=Date:To:From:Subject:From; b=v698peU7iVlM1Qk8D5IC3/jem8Vl/Sx8PrUVd3OE+jFVhvaic/ybYshVJPQnIvxl0 M14VfjN8wUsv6MTTVEeP7521I8gin0VmfIXwKkRBMn0yoktQtQVYgFqnRIs6HJlA1z fJ2OaJu4l+2pVRhxWXu7WsTUfY2yH1oicQ/gXJOI= Date: Mon, 23 Dec 2024 16:45:02 -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,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,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: <20241224004503.4239FC4CED3@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: Mon, 23 Dec 2024 17:40:51 +0800 Like other levels of page tables, also use mmu gather mechanism to free p4d level page table. Link: https://lkml.kernel.org/r/7c12112047ac230809aacd0379259414b9b0d3a3.1734945104.git.zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Originally-by: Peter Zijlstra (Intel) Cc: Alexander Gordeev 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: Kevin Brodsky Cc: Lorenzo Stoakes Cc: Matthew Wilcox (Oracle) Cc: Mike Rapoport (Microsoft) Cc: Muchun Song Cc: Nicholas Piggin 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-move-pagetable_dtor-to-__tlb_remove_table.patch s390-pgtable-also-move-pagetable_dtor-of-pxd-to-__tlb_remove_table.patch mm-pgtable-introduce-generic-__tlb_remove_table.patch mm-pgtable-move-__tlb_remove_table_one-in-x86-to-generic-file.patch mm-pgtable-remove-tlb_remove_page_ptdesc.patch mm-pgtable-remove-tlb_remove_ptdesc.patch mm-pgtable-introduce-generic-pagetable_dtor_free.patch