linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: peterz@infradead.org, 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
Cc: 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,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: [PATCH v2 1/6] mm: pgtable: make generic tlb_remove_table() use struct ptdesc
Date: Tue, 25 Feb 2025 11:45:51 +0800	[thread overview]
Message-ID: <5be8c3ab7bd68510bf0db4cf84010f4dfe372917.1740454179.git.zhengqi.arch@bytedance.com> (raw)
In-Reply-To: <cover.1740454179.git.zhengqi.arch@bytedance.com>

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@bytedance.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 b35b36fa7aabf..54f579750c8e5 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -232,10 +232,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



  reply	other threads:[~2025-02-25  3:46 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25  3:45 [PATCH v2 0/6] remove tlb_remove_page_ptdesc() Qi Zheng
2025-02-25  3:45 ` Qi Zheng [this message]
2025-02-26  8:30   ` [PATCH v2 1/6] mm: pgtable: make generic tlb_remove_table() use struct ptdesc Kevin Brodsky
2025-02-25  3:45 ` [PATCH v2 2/6] mm: pgtable: change pt parameter of tlb_remove_ptdesc() to struct ptdesc * Qi Zheng
2025-02-26  8:31   ` Kevin Brodsky
2025-02-25  3:45 ` [PATCH v2 3/6] mm: pgtable: convert some architectures to use tlb_remove_ptdesc() Qi Zheng
2025-02-26  8:31   ` Kevin Brodsky
2025-02-27 13:21   ` Geert Uytterhoeven
2025-02-28  2:44     ` Qi Zheng
2025-03-03  7:26   ` [PATCH v2 3/6 update] " Qi Zheng
2025-03-03 23:53     ` Andrew Morton
2025-03-04  2:31       ` Qi Zheng
2025-03-04  4:08         ` Andrew Morton
2025-03-04  6:11           ` Qi Zheng
2025-02-25  3:45 ` [PATCH v2 4/6] riscv: pgtable: unconditionally " Qi Zheng
2025-03-03  1:45   ` [External] " yunhui cui
2025-03-03  7:15     ` Qi Zheng
2025-02-25  3:45 ` [PATCH v2 5/6] x86: pgtable: convert to " Qi Zheng
2025-02-26  2:35   ` Andrew Morton
2025-02-26  2:40     ` Qi Zheng
2025-02-25  3:45 ` [PATCH v2 6/6] mm: pgtable: remove tlb_remove_page_ptdesc() Qi Zheng
2025-02-26  8:32   ` Kevin Brodsky

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=5be8c3ab7bd68510bf0db4cf84010f4dfe372917.1740454179.git.zhengqi.arch@bytedance.com \
    --to=zhengqi.arch@bytedance.com \
    --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=peterz@infradead.org \
    --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 \
    /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