Skip to contentSkip to conversation

mm-pgtable-make-generic-tlb_remove_table-use-struct-ptdesc.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Apr 1, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: pgtable: make generic tlb_remove_table() use struct ptdesc
has been removed from the -mm tree. Its filename was
mm-pgtable-make-generic-tlb_remove_table-use-struct-ptdesc.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Qi Zheng <[email protected]>
Subject: mm: pgtable: make generic tlb_remove_table() use struct ptdesc
Date: Tue, 25 Feb 2025 11:45:51 +0800

Patch series "remove tlb_remove_page_ptdesc()", v2.

As suggested by Peter Zijlstra below [1], this series aims to remove tlb_remove_page_ptdesc().

: Fundamentally tlb_remove_page() is about removing *pages* as from a PTE, : there should not be a page-table anywhere near here *ever*. :
: Yes, some architectures use tlb_remove_page() for page-tables too, but : that is more or less an implementation detail that can be fixed.

After this series, all architectures use tlb_remove_table() or tlb_remove_ptdesc() to remove the page table pages. In the future, once all architectures using tlb_remove_table() have also converted to using struct ptdesc (eg. powerpc), it may be possible to use only tlb_remove_ptdesc().

[1] https://lore.kernel.org/linux-mm/[email protected]/

This patch (of 6):

Now only arm will call tlb_remove_ptdesc()/tlb_remove_table() when CONFIG_MMU_GATHER_TABLE_FREE is disabled. In this case, the type of the table parameter is actually struct ptdesc * instead of struct page *.

Since struct ptdesc still overlaps with struct page and has not been separated from it, forcing the table parameter to struct page * will not cause any problems at this time. But this is definitely incorrect and needs to be fixed. So just like the generic __tlb_remove_table(), let generic tlb_remove_table() use struct ptdesc by default when CONFIG_MMU_GATHER_TABLE_FREE is disabled.

Cc Alexandre Ghiti <[email protected]>
Cc "Aneesh Kumar K.V" <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Dave Hansen <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Hugh Dickens <[email protected]>
Cc Jann Horn <[email protected]>
Cc Matthew Wilcow (Oracle) <[email protected]>
Cc "Mike Rapoport (IBM)" <[email protected]>
Cc Muchun Song <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc Peter Zijlstra (Intel) <[email protected]>
Cc Rik van Riel <[email protected]>
Cc Vishal Moola (Oracle) <[email protected]>
Cc Will Deacon <[email protected]>
Cc Yu Zhao <[email protected]>

---

 include/asm-generic/tlb.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/asm-generic/tlb.h renamed from include/asm-generic/tlb.h~mm-pgtable-make-generic-tlb_remove_table-use-struct-ptdesc +3 -3
@@ -227,10 +227,10 @@ static inline void tlb_remove_page(struc
  */
 static inline void tlb_remove_table(struct mmu_gather *tlb, void *table)
 {
-	struct page *page = (struct page *)table;
+	struct ptdesc *ptdesc = (struct ptdesc *)table;
 
-	pagetable_dtor(page_ptdesc(page));
-	tlb_remove_page(tlb, page);
+	pagetable_dtor(ptdesc);
+	tlb_remove_page(tlb, ptdesc_page(ptdesc));
 }
 #endif /* CONFIG_MMU_GATHER_TABLE_FREE */
 

_

Patches currently in -mm which might be from [email protected] are