Skip to content

Commit f21bb37

Browse files
Qi Zhengakpm00
authored andcommitted
mm: pgtable: make generic tlb_remove_table() use struct ptdesc
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. Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/5be8c3ab7bd68510bf0db4cf84010f4dfe372917.1740454179.git.zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng <[email protected]> Reviewed-by: Kevin Brodsky <[email protected]> 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]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 1b3d3e9 commit f21bb37

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/asm-generic/tlb.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,10 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page);
227227
*/
228228
static inline void tlb_remove_table(struct mmu_gather *tlb, void *table)
229229
{
230-
struct page *page = (struct page *)table;
230+
struct ptdesc *ptdesc = (struct ptdesc *)table;
231231

232-
pagetable_dtor(page_ptdesc(page));
233-
tlb_remove_page(tlb, page);
232+
pagetable_dtor(ptdesc);
233+
tlb_remove_page(tlb, ptdesc_page(ptdesc));
234234
}
235235
#endif /* CONFIG_MMU_GATHER_TABLE_FREE */
236236

0 commit comments

Comments
 (0)