Message ID | b37435768345e0fcf7ea358f69b4a71767f0f530.1734945104.git.zhengqi.arch@bytedance.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | move pagetable_*_dtor() to __tlb_remove_table() | expand |
On Mon, Dec 23, 2024 at 05:41:01PM +0800, Qi Zheng wrote: > Here we are explicitly dealing with struct page, and the following logic > semms strange: > > tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); > > tlb_remove_page_ptdesc > --> tlb_remove_page(tlb, ptdesc_page(pt)); > > So remove tlb_remove_page_ptdesc() and make callers call tlb_remove_page() > directly. Please don't. The ptdesc wrappers are there as a part of reducing the size of struct page project [1]. For now struct ptdesc overlaps struct page, but the goal is to have them separate and always operate on struct ptdesc when working with page tables. [1] https://kernelnewbies.org/MatthewWilcox/Memdescs > Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com> > Originally-by: Peter Zijlstra (Intel) <peterz@infradead.org> > --- > arch/csky/include/asm/pgalloc.h | 2 +- > arch/hexagon/include/asm/pgalloc.h | 2 +- > arch/loongarch/include/asm/pgalloc.h | 2 +- > arch/m68k/include/asm/sun3_pgalloc.h | 2 +- > arch/mips/include/asm/pgalloc.h | 2 +- > arch/nios2/include/asm/pgalloc.h | 2 +- > arch/openrisc/include/asm/pgalloc.h | 2 +- > arch/riscv/include/asm/pgalloc.h | 2 +- > arch/sh/include/asm/pgalloc.h | 2 +- > arch/um/include/asm/pgalloc.h | 8 ++++---- > include/asm-generic/tlb.h | 6 ------ > 11 files changed, 13 insertions(+), 19 deletions(-) > > diff --git a/arch/csky/include/asm/pgalloc.h b/arch/csky/include/asm/pgalloc.h > index f1ce5b7b28f22..936a43a49e704 100644 > --- a/arch/csky/include/asm/pgalloc.h > +++ b/arch/csky/include/asm/pgalloc.h > @@ -64,7 +64,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) > #define __pte_free_tlb(tlb, pte, address) \ > do { \ > pagetable_dtor(page_ptdesc(pte)); \ > - tlb_remove_page_ptdesc(tlb, page_ptdesc(pte)); \ > + tlb_remove_page(tlb, (pte)); \ > } while (0) > > extern void pagetable_init(void); > diff --git a/arch/hexagon/include/asm/pgalloc.h b/arch/hexagon/include/asm/pgalloc.h > index 40e42a0e71673..8b1550498f1bf 100644 > --- a/arch/hexagon/include/asm/pgalloc.h > +++ b/arch/hexagon/include/asm/pgalloc.h > @@ -90,7 +90,7 @@ static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, > #define __pte_free_tlb(tlb, pte, addr) \ > do { \ > pagetable_dtor((page_ptdesc(pte))); \ > - tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); \ > + tlb_remove_page((tlb), (pte)); \ > } while (0) > > #endif > diff --git a/arch/loongarch/include/asm/pgalloc.h b/arch/loongarch/include/asm/pgalloc.h > index 7211dff8c969e..5a4f22aeb6189 100644 > --- a/arch/loongarch/include/asm/pgalloc.h > +++ b/arch/loongarch/include/asm/pgalloc.h > @@ -58,7 +58,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm) > #define __pte_free_tlb(tlb, pte, address) \ > do { \ > pagetable_dtor(page_ptdesc(pte)); \ > - tlb_remove_page_ptdesc((tlb), page_ptdesc(pte)); \ > + tlb_remove_page((tlb), (pte)); \ > } while (0) > > #ifndef __PAGETABLE_PMD_FOLDED > diff --git a/arch/m68k/include/asm/sun3_pgalloc.h b/arch/m68k/include/asm/sun3_pgalloc.h > index 2b626cb3ad0ae..63d9f95f5e3dd 100644 > --- a/arch/m68k/include/asm/sun3_pgalloc.h > +++ b/arch/m68k/include/asm/sun3_pgalloc.h > @@ -20,7 +20,7 @@ extern const char bad_pmd_string[]; > #define __pte_free_tlb(tlb, pte, addr) \ > do { \ > pagetable_dtor(page_ptdesc(pte)); \ > - tlb_remove_page_ptdesc((tlb), page_ptdesc(pte)); \ > + tlb_remove_page((tlb), (pte)); \ > } while (0) > > static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) > diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h > index 36d9805033c4b..bbee21345154b 100644 > --- a/arch/mips/include/asm/pgalloc.h > +++ b/arch/mips/include/asm/pgalloc.h > @@ -57,7 +57,7 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) > #define __pte_free_tlb(tlb, pte, address) \ > do { \ > pagetable_dtor(page_ptdesc(pte)); \ > - tlb_remove_page_ptdesc((tlb), page_ptdesc(pte)); \ > + tlb_remove_page((tlb), (pte)); \ > } while (0) > > #ifndef __PAGETABLE_PMD_FOLDED > diff --git a/arch/nios2/include/asm/pgalloc.h b/arch/nios2/include/asm/pgalloc.h > index 12a536b7bfbd4..641cec8fb2a22 100644 > --- a/arch/nios2/include/asm/pgalloc.h > +++ b/arch/nios2/include/asm/pgalloc.h > @@ -31,7 +31,7 @@ extern pgd_t *pgd_alloc(struct mm_struct *mm); > #define __pte_free_tlb(tlb, pte, addr) \ > do { \ > pagetable_dtor(page_ptdesc(pte)); \ > - tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); \ > + tlb_remove_page((tlb), (pte)); \ > } while (0) > > #endif /* _ASM_NIOS2_PGALLOC_H */ > diff --git a/arch/openrisc/include/asm/pgalloc.h b/arch/openrisc/include/asm/pgalloc.h > index 596e2355824e3..e9b9bc53ece0b 100644 > --- a/arch/openrisc/include/asm/pgalloc.h > +++ b/arch/openrisc/include/asm/pgalloc.h > @@ -69,7 +69,7 @@ extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm); > #define __pte_free_tlb(tlb, pte, addr) \ > do { \ > pagetable_dtor(page_ptdesc(pte)); \ > - tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); \ > + tlb_remove_page((tlb), (pte)); \ > } while (0) > > #endif > diff --git a/arch/riscv/include/asm/pgalloc.h b/arch/riscv/include/asm/pgalloc.h > index c8907b8317115..ab4f9b2cf9e11 100644 > --- a/arch/riscv/include/asm/pgalloc.h > +++ b/arch/riscv/include/asm/pgalloc.h > @@ -29,7 +29,7 @@ static inline void riscv_tlb_remove_ptdesc(struct mmu_gather *tlb, void *pt) > tlb_remove_ptdesc(tlb, pt); > } else { > pagetable_dtor(pt); > - tlb_remove_page_ptdesc(tlb, pt); > + tlb_remove_page(tlb, ptdesc_page((struct ptdesc *)pt)); > } > } > > diff --git a/arch/sh/include/asm/pgalloc.h b/arch/sh/include/asm/pgalloc.h > index 96d938fdf2244..43812b2363efd 100644 > --- a/arch/sh/include/asm/pgalloc.h > +++ b/arch/sh/include/asm/pgalloc.h > @@ -35,7 +35,7 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, > #define __pte_free_tlb(tlb, pte, addr) \ > do { \ > pagetable_dtor(page_ptdesc(pte)); \ > - tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); \ > + tlb_remove_page((tlb), (pte)); \ > } while (0) > > #endif /* __ASM_SH_PGALLOC_H */ > diff --git a/arch/um/include/asm/pgalloc.h b/arch/um/include/asm/pgalloc.h > index f0af23c3aeb2b..98190c318a8e9 100644 > --- a/arch/um/include/asm/pgalloc.h > +++ b/arch/um/include/asm/pgalloc.h > @@ -28,7 +28,7 @@ extern pgd_t *pgd_alloc(struct mm_struct *); > #define __pte_free_tlb(tlb, pte, address) \ > do { \ > pagetable_dtor(page_ptdesc(pte)); \ > - tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); \ > + tlb_remove_page((tlb), (pte)); \ > } while (0) > > #if CONFIG_PGTABLE_LEVELS > 2 > @@ -36,15 +36,15 @@ do { \ > #define __pmd_free_tlb(tlb, pmd, address) \ > do { \ > pagetable_dtor(virt_to_ptdesc(pmd)); \ > - tlb_remove_page_ptdesc((tlb), virt_to_ptdesc(pmd)); \ > + tlb_remove_page((tlb), virt_to_page(pmd)); \ > } while (0) > > #if CONFIG_PGTABLE_LEVELS > 3 > > #define __pud_free_tlb(tlb, pud, address) \ > do { \ > - pagetable_dtor(virt_to_ptdesc(pud)); \ > - tlb_remove_page_ptdesc((tlb), virt_to_ptdesc(pud)); \ > + pagetable_dtor(virt_to_ptdesc(pud)); \ > + tlb_remove_page((tlb), virt_to_page(pud)); \ > } while (0) > > #endif > diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h > index 69de47c7ef3c5..8d6cfe5058543 100644 > --- a/include/asm-generic/tlb.h > +++ b/include/asm-generic/tlb.h > @@ -504,12 +504,6 @@ static inline void tlb_remove_ptdesc(struct mmu_gather *tlb, void *pt) > tlb_remove_table(tlb, pt); > } > > -/* Like tlb_remove_ptdesc, but for page-like page directories. */ > -static inline void tlb_remove_page_ptdesc(struct mmu_gather *tlb, struct ptdesc *pt) > -{ > - tlb_remove_page(tlb, ptdesc_page(pt)); > -} > - > static inline void tlb_change_page_size(struct mmu_gather *tlb, > unsigned int page_size) > { > -- > 2.20.1 >
Hi Mike, On 2024/12/28 17:26, Mike Rapoport wrote: > On Mon, Dec 23, 2024 at 05:41:01PM +0800, Qi Zheng wrote: >> Here we are explicitly dealing with struct page, and the following logic >> semms strange: >> >> tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); >> >> tlb_remove_page_ptdesc >> --> tlb_remove_page(tlb, ptdesc_page(pt)); >> >> So remove tlb_remove_page_ptdesc() and make callers call tlb_remove_page() >> directly. > > Please don't. The ptdesc wrappers are there as a part of reducing the size > of struct page project [1]. > > For now struct ptdesc overlaps struct page, but the goal is to have them > separate and always operate on struct ptdesc when working with page tables. OK, so tlb_remove_page_ptdesc() and tlb_remove_ptdesc() are somewhat intermediate products of the project. Hi Andrew, can you help remove [PATCH v3 15/17], [PATCH v3 16/17] and [PATCH v3 17/17] from the mm-unstable branch? For [PATCH v3 17/17], I can send it separately later, or Kevin Brodsky can help do this in his patch series. ;) Thanks, Qi > > [1] https://kernelnewbies.org/MatthewWilcox/Memdescs >
On Mon, 30 Dec 2024 11:12:00 +0800 Qi Zheng <zhengqi.arch@bytedance.com> wrote: > > For now struct ptdesc overlaps struct page, but the goal is to have them > > separate and always operate on struct ptdesc when working with page tables. > > OK, so tlb_remove_page_ptdesc() and tlb_remove_ptdesc() are somewhat > intermediate products of the project. > > Hi Andrew, can you help remove [PATCH v3 15/17], [PATCH v3 16/17] and > [PATCH v3 17/17] from the mm-unstable branch? > > For [PATCH v3 17/17], I can send it separately later, or Kevin Brodsky > can help do this in his patch series. ;) I think it would be best if you were to send a v4 series. Please ensure that the changelogs are appropriately updated to reflect these (and any other) changes.
Hi Andrew, On 2024/12/30 12:55, Andrew Morton wrote: > On Mon, 30 Dec 2024 11:12:00 +0800 Qi Zheng <zhengqi.arch@bytedance.com> wrote: > >>> For now struct ptdesc overlaps struct page, but the goal is to have them >>> separate and always operate on struct ptdesc when working with page tables. >> >> OK, so tlb_remove_page_ptdesc() and tlb_remove_ptdesc() are somewhat >> intermediate products of the project. >> >> Hi Andrew, can you help remove [PATCH v3 15/17], [PATCH v3 16/17] and >> [PATCH v3 17/17] from the mm-unstable branch? >> >> For [PATCH v3 17/17], I can send it separately later, or Kevin Brodsky >> can help do this in his patch series. ;) > > I think it would be best if you were to send a v4 series. Please > ensure that the changelogs are appropriately updated to reflect these > (and any other) changes. Got it. Will send a v4 ASAP (remove [PATCH v3 15/17] and [PATCH v3 16/17], keep [PATCH v3 17/17]). Thanks! >
On Sat, Dec 28, 2024 at 11:26:22AM +0200, Mike Rapoport wrote: > On Mon, Dec 23, 2024 at 05:41:01PM +0800, Qi Zheng wrote: > > Here we are explicitly dealing with struct page, and the following logic > > semms strange: > > > > tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); > > > > tlb_remove_page_ptdesc > > --> tlb_remove_page(tlb, ptdesc_page(pt)); > > > > So remove tlb_remove_page_ptdesc() and make callers call tlb_remove_page() > > directly. > > Please don't. The ptdesc wrappers are there as a part of reducing the size > of struct page project [1]. > > For now struct ptdesc overlaps struct page, but the goal is to have them > separate and always operate on struct ptdesc when working with page tables. I don't see how the current idiotic code helps with that at all. 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. So no, please keep these patches and kill this utterly idiotic code. The only thing that should eventually care about page-tables is tlb_remove_table(), and that takes a 'void *' and is expected to match whatever __tlb_remove_table() does. Flipping those to pgdesc, once its actually a thing, should be fairly straight forward.
On 2025/1/3 19:14, Peter Zijlstra wrote: > On Sat, Dec 28, 2024 at 11:26:22AM +0200, Mike Rapoport wrote: >> On Mon, Dec 23, 2024 at 05:41:01PM +0800, Qi Zheng wrote: >>> Here we are explicitly dealing with struct page, and the following logic >>> semms strange: >>> >>> tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); >>> >>> tlb_remove_page_ptdesc >>> --> tlb_remove_page(tlb, ptdesc_page(pt)); >>> >>> So remove tlb_remove_page_ptdesc() and make callers call tlb_remove_page() >>> directly. >> >> Please don't. The ptdesc wrappers are there as a part of reducing the size >> of struct page project [1]. >> >> For now struct ptdesc overlaps struct page, but the goal is to have them >> separate and always operate on struct ptdesc when working with page tables. > > I don't see how the current idiotic code helps with that at all. > > 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. > > So no, please keep these patches and kill this utterly idiotic code. > > The only thing that should eventually care about page-tables is > tlb_remove_table(), and that takes a 'void *' and is expected to match > whatever __tlb_remove_table() does. > > Flipping those to pgdesc, once its actually a thing, should be fairly > straight forward. Well, since I've already sent v4, and that patch series is mainly for bug fix, I'll send a separate patch series to do this. Thanks!
diff --git a/arch/csky/include/asm/pgalloc.h b/arch/csky/include/asm/pgalloc.h index f1ce5b7b28f22..936a43a49e704 100644 --- a/arch/csky/include/asm/pgalloc.h +++ b/arch/csky/include/asm/pgalloc.h @@ -64,7 +64,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) #define __pte_free_tlb(tlb, pte, address) \ do { \ pagetable_dtor(page_ptdesc(pte)); \ - tlb_remove_page_ptdesc(tlb, page_ptdesc(pte)); \ + tlb_remove_page(tlb, (pte)); \ } while (0) extern void pagetable_init(void); diff --git a/arch/hexagon/include/asm/pgalloc.h b/arch/hexagon/include/asm/pgalloc.h index 40e42a0e71673..8b1550498f1bf 100644 --- a/arch/hexagon/include/asm/pgalloc.h +++ b/arch/hexagon/include/asm/pgalloc.h @@ -90,7 +90,7 @@ static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, #define __pte_free_tlb(tlb, pte, addr) \ do { \ pagetable_dtor((page_ptdesc(pte))); \ - tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); \ + tlb_remove_page((tlb), (pte)); \ } while (0) #endif diff --git a/arch/loongarch/include/asm/pgalloc.h b/arch/loongarch/include/asm/pgalloc.h index 7211dff8c969e..5a4f22aeb6189 100644 --- a/arch/loongarch/include/asm/pgalloc.h +++ b/arch/loongarch/include/asm/pgalloc.h @@ -58,7 +58,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm) #define __pte_free_tlb(tlb, pte, address) \ do { \ pagetable_dtor(page_ptdesc(pte)); \ - tlb_remove_page_ptdesc((tlb), page_ptdesc(pte)); \ + tlb_remove_page((tlb), (pte)); \ } while (0) #ifndef __PAGETABLE_PMD_FOLDED diff --git a/arch/m68k/include/asm/sun3_pgalloc.h b/arch/m68k/include/asm/sun3_pgalloc.h index 2b626cb3ad0ae..63d9f95f5e3dd 100644 --- a/arch/m68k/include/asm/sun3_pgalloc.h +++ b/arch/m68k/include/asm/sun3_pgalloc.h @@ -20,7 +20,7 @@ extern const char bad_pmd_string[]; #define __pte_free_tlb(tlb, pte, addr) \ do { \ pagetable_dtor(page_ptdesc(pte)); \ - tlb_remove_page_ptdesc((tlb), page_ptdesc(pte)); \ + tlb_remove_page((tlb), (pte)); \ } while (0) static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h index 36d9805033c4b..bbee21345154b 100644 --- a/arch/mips/include/asm/pgalloc.h +++ b/arch/mips/include/asm/pgalloc.h @@ -57,7 +57,7 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) #define __pte_free_tlb(tlb, pte, address) \ do { \ pagetable_dtor(page_ptdesc(pte)); \ - tlb_remove_page_ptdesc((tlb), page_ptdesc(pte)); \ + tlb_remove_page((tlb), (pte)); \ } while (0) #ifndef __PAGETABLE_PMD_FOLDED diff --git a/arch/nios2/include/asm/pgalloc.h b/arch/nios2/include/asm/pgalloc.h index 12a536b7bfbd4..641cec8fb2a22 100644 --- a/arch/nios2/include/asm/pgalloc.h +++ b/arch/nios2/include/asm/pgalloc.h @@ -31,7 +31,7 @@ extern pgd_t *pgd_alloc(struct mm_struct *mm); #define __pte_free_tlb(tlb, pte, addr) \ do { \ pagetable_dtor(page_ptdesc(pte)); \ - tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); \ + tlb_remove_page((tlb), (pte)); \ } while (0) #endif /* _ASM_NIOS2_PGALLOC_H */ diff --git a/arch/openrisc/include/asm/pgalloc.h b/arch/openrisc/include/asm/pgalloc.h index 596e2355824e3..e9b9bc53ece0b 100644 --- a/arch/openrisc/include/asm/pgalloc.h +++ b/arch/openrisc/include/asm/pgalloc.h @@ -69,7 +69,7 @@ extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm); #define __pte_free_tlb(tlb, pte, addr) \ do { \ pagetable_dtor(page_ptdesc(pte)); \ - tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); \ + tlb_remove_page((tlb), (pte)); \ } while (0) #endif diff --git a/arch/riscv/include/asm/pgalloc.h b/arch/riscv/include/asm/pgalloc.h index c8907b8317115..ab4f9b2cf9e11 100644 --- a/arch/riscv/include/asm/pgalloc.h +++ b/arch/riscv/include/asm/pgalloc.h @@ -29,7 +29,7 @@ static inline void riscv_tlb_remove_ptdesc(struct mmu_gather *tlb, void *pt) tlb_remove_ptdesc(tlb, pt); } else { pagetable_dtor(pt); - tlb_remove_page_ptdesc(tlb, pt); + tlb_remove_page(tlb, ptdesc_page((struct ptdesc *)pt)); } } diff --git a/arch/sh/include/asm/pgalloc.h b/arch/sh/include/asm/pgalloc.h index 96d938fdf2244..43812b2363efd 100644 --- a/arch/sh/include/asm/pgalloc.h +++ b/arch/sh/include/asm/pgalloc.h @@ -35,7 +35,7 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, #define __pte_free_tlb(tlb, pte, addr) \ do { \ pagetable_dtor(page_ptdesc(pte)); \ - tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); \ + tlb_remove_page((tlb), (pte)); \ } while (0) #endif /* __ASM_SH_PGALLOC_H */ diff --git a/arch/um/include/asm/pgalloc.h b/arch/um/include/asm/pgalloc.h index f0af23c3aeb2b..98190c318a8e9 100644 --- a/arch/um/include/asm/pgalloc.h +++ b/arch/um/include/asm/pgalloc.h @@ -28,7 +28,7 @@ extern pgd_t *pgd_alloc(struct mm_struct *); #define __pte_free_tlb(tlb, pte, address) \ do { \ pagetable_dtor(page_ptdesc(pte)); \ - tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); \ + tlb_remove_page((tlb), (pte)); \ } while (0) #if CONFIG_PGTABLE_LEVELS > 2 @@ -36,15 +36,15 @@ do { \ #define __pmd_free_tlb(tlb, pmd, address) \ do { \ pagetable_dtor(virt_to_ptdesc(pmd)); \ - tlb_remove_page_ptdesc((tlb), virt_to_ptdesc(pmd)); \ + tlb_remove_page((tlb), virt_to_page(pmd)); \ } while (0) #if CONFIG_PGTABLE_LEVELS > 3 #define __pud_free_tlb(tlb, pud, address) \ do { \ - pagetable_dtor(virt_to_ptdesc(pud)); \ - tlb_remove_page_ptdesc((tlb), virt_to_ptdesc(pud)); \ + pagetable_dtor(virt_to_ptdesc(pud)); \ + tlb_remove_page((tlb), virt_to_page(pud)); \ } while (0) #endif diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index 69de47c7ef3c5..8d6cfe5058543 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h @@ -504,12 +504,6 @@ static inline void tlb_remove_ptdesc(struct mmu_gather *tlb, void *pt) tlb_remove_table(tlb, pt); } -/* Like tlb_remove_ptdesc, but for page-like page directories. */ -static inline void tlb_remove_page_ptdesc(struct mmu_gather *tlb, struct ptdesc *pt) -{ - tlb_remove_page(tlb, ptdesc_page(pt)); -} - static inline void tlb_change_page_size(struct mmu_gather *tlb, unsigned int page_size) {
Here we are explicitly dealing with struct page, and the following logic semms strange: tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); tlb_remove_page_ptdesc --> tlb_remove_page(tlb, ptdesc_page(pt)); So remove tlb_remove_page_ptdesc() and make callers call tlb_remove_page() directly. Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com> Originally-by: Peter Zijlstra (Intel) <peterz@infradead.org> --- arch/csky/include/asm/pgalloc.h | 2 +- arch/hexagon/include/asm/pgalloc.h | 2 +- arch/loongarch/include/asm/pgalloc.h | 2 +- arch/m68k/include/asm/sun3_pgalloc.h | 2 +- arch/mips/include/asm/pgalloc.h | 2 +- arch/nios2/include/asm/pgalloc.h | 2 +- arch/openrisc/include/asm/pgalloc.h | 2 +- arch/riscv/include/asm/pgalloc.h | 2 +- arch/sh/include/asm/pgalloc.h | 2 +- arch/um/include/asm/pgalloc.h | 8 ++++---- include/asm-generic/tlb.h | 6 ------ 11 files changed, 13 insertions(+), 19 deletions(-)