From: Peter Zijlstra <peterz@infradead.org>
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: kevin.brodsky@arm.com, riel@surriel.com, vishal.moola@gmail.com,
david@redhat.com, jannh@google.com, hughd@google.com,
willy@infradead.org, yuzhao@google.com, muchun.song@linux.dev,
akpm@linux-foundation.org, will@kernel.org,
aneesh.kumar@kernel.org, npiggin@gmail.com, arnd@arndb.de,
dave.hansen@linux.intel.com, rppt@kernel.org,
alexghiti@rivosinc.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org,
linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev,
linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org,
linux-openrisc@vger.kernel.org, linux-sh@vger.kernel.org,
linux-um@lists.infradead.org, x86@kernel.org,
linux-riscv@lists.infradead.org
Subject: Re: [PATCH 0/5] remove tlb_remove_page_ptdesc()
Date: Fri, 24 Jan 2025 12:47:59 +0100 [thread overview]
Message-ID: <20250124114759.GB15996@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <cover.1737637631.git.zhengqi.arch@bytedance.com>
On Thu, Jan 23, 2025 at 09:26:13PM +0800, Qi Zheng wrote:
> Hi all,
>
> 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().
Right, so I don't think Sparc and Power care to use ptdesc, they're
using non page page-tables.
At the very least we should do something like this, the only point of
having tlb_remove_ptdesc() is type safety, there really is no benefit
from it in any other way.
---
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index dec030cb1210..a6731328db6f 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -504,7 +504,7 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
return tlb_remove_page_size(tlb, page, PAGE_SIZE);
}
-static inline void tlb_remove_ptdesc(struct mmu_gather *tlb, void *pt)
+static inline void tlb_remove_ptdesc(struct mmu_gather *tlb, struct ptdesc *pt)
{
tlb_remove_table(tlb, pt);
}
next prev parent reply other threads:[~2025-01-24 11:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-23 13:26 Qi Zheng
2025-01-23 13:26 ` [PATCH 1/5] mm: pgtable: make generic tlb_remove_table() use struct ptdesc Qi Zheng
2025-01-23 13:26 ` [PATCH 2/5] mm: pgtable: convert some architectures to use tlb_remove_ptdesc() Qi Zheng
2025-01-23 13:26 ` [PATCH 3/5] riscv: pgtable: unconditionally " Qi Zheng
2025-01-23 13:26 ` [PATCH 4/5] x86: pgtable: unconditionally use tlb_remove_table() Qi Zheng
2025-01-24 11:38 ` Peter Zijlstra
2025-01-24 13:00 ` Qi Zheng
2025-01-27 16:02 ` Peter Zijlstra
2025-01-23 13:26 ` [PATCH 5/5] mm: pgtable: remove tlb_remove_page_ptdesc() Qi Zheng
2025-01-24 11:47 ` Peter Zijlstra [this message]
2025-01-24 13:04 ` [PATCH 0/5] " Qi Zheng
2025-02-08 7:22 ` Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250124114759.GB15996@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=alexghiti@rivosinc.com \
--cc=aneesh.kumar@kernel.org \
--cc=arnd@arndb.de \
--cc=dave.hansen@linux.intel.com \
--cc=david@redhat.com \
--cc=hughd@google.com \
--cc=jannh@google.com \
--cc=kevin.brodsky@arm.com \
--cc=linux-csky@vger.kernel.org \
--cc=linux-hexagon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-openrisc@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=loongarch@lists.linux.dev \
--cc=muchun.song@linux.dev \
--cc=npiggin@gmail.com \
--cc=riel@surriel.com \
--cc=rppt@kernel.org \
--cc=vishal.moola@gmail.com \
--cc=will@kernel.org \
--cc=willy@infradead.org \
--cc=x86@kernel.org \
--cc=yuzhao@google.com \
--cc=zhengqi.arch@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox