[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <e2a1b07eda16eb84bdc51f6227fec02f2c0a54f7.1737637631.git.zhengqi.arch@bytedance.com>
Date: Thu, 23 Jan 2025 21:26:14 +0800
From: Qi Zheng <zhengqi.arch@...edance.com>
To: peterz@...radead.org,
kevin.brodsky@....com,
riel@...riel.com,
vishal.moola@...il.com,
david@...hat.com,
jannh@...gle.com,
hughd@...gle.com,
willy@...radead.org,
yuzhao@...gle.com,
muchun.song@...ux.dev,
akpm@...ux-foundation.org,
will@...nel.org,
aneesh.kumar@...nel.org,
npiggin@...il.com,
arnd@...db.de,
dave.hansen@...ux.intel.com,
rppt@...nel.org,
alexghiti@...osinc.com
Cc: linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
linux-csky@...r.kernel.org,
linux-hexagon@...r.kernel.org,
loongarch@...ts.linux.dev,
linux-m68k@...ts.linux-m68k.org,
linux-mips@...r.kernel.org,
linux-openrisc@...r.kernel.org,
linux-sh@...r.kernel.org,
linux-um@...ts.infradead.org,
x86@...nel.org,
linux-riscv@...ts.infradead.org,
Qi Zheng <zhengqi.arch@...edance.com>
Subject: [PATCH 1/5] mm: pgtable: make generic tlb_remove_table() use struct ptdesc
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.
Signed-off-by: Qi Zheng <zhengqi.arch@...edance.com>
---
include/asm-generic/tlb.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index e402aef79c93e..10cdbe0e7adfe 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -228,10 +228,10 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page);
*/
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 */
--
2.20.1
Powered by blists - more mailing lists