From nobody Mon Feb 9 09:43:13 2026 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA0123126B1; Tue, 27 Jan 2026 12:16:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769516221; cv=none; b=H24ZVOsDZRUJmgg+ZR+UQfWj4reyqsO2V3wN+w4+ChyWwtRDPqUqSWrZA1gaRpO5t3+Cs2i8v0EcKPmzALtODoRfP/qNt1ERZ4f0fzcUL/d9s7nam6EQUGugvLNAtnbwkDAdJqfh1mI1QscSzSaOOl241JQwMeklqA9gJba1hmk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769516221; c=relaxed/simple; bh=l4vn0jafzOH48gJFS9ZbmhoGcYGN1pHeTBN6xc8KkEs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BGz/3EV5kZca4m6PXuCC2ljMtbDrxsvsH7vY7z8VmsH4nFHY98ujb2ULWPbpBoH4MWyXhVHssOOSSSZTXVcDlLosI22sjAbZCAPlcWbeT7UDMyfNiTMvhjQ57IsexCyJYgHZmnLmZ5q+WzJaMnu4o4Tk7jGMKQi9nEXXs4QyrZQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=jSGS7Oe7; arc=none smtp.client-ip=95.215.58.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="jSGS7Oe7" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1769516217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cQBzLGwNWLhDwXoP+ZRSwxq1ZRzbrKmRMjKOPlq54sI=; b=jSGS7Oe7flEf1a3jjawW71oBSQhZPtzIf1jHxOLDpEaGXg/8H0JQMtgOEgm1lxSI0nFjif CMLoz1yjkN0nwmCjWOwy4dWfqN8+bvppy0gq8toChP4Uc6ASbK4hQf7zJ4fTJfyy7Xu7HL RfqIvb9PoL98f2B3qx4iqWkzECkNTi0= From: Qi Zheng To: david@kernel.org, andreas@gaisler.com, richard.weiyang@gmail.com, will@kernel.org, peterz@infradead.org, aneesh.kumar@kernel.org, npiggin@gmail.com, dev.jain@arm.com, ioworker0@gmail.com, linmag7@gmail.com, akpm@linux-foundation.org Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-alpha@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-um@lists.infradead.org, sparclinux@vger.kernel.org, Qi Zheng Subject: [PATCH v4 7/8] mm: convert __HAVE_ARCH_TLB_REMOVE_TABLE to CONFIG_HAVE_ARCH_TLB_REMOVE_TABLE config Date: Tue, 27 Jan 2026 20:13:00 +0800 Message-ID: <5ebfa3d4b56e63c6906bda5eccaa9f7194d3a86b.1769515122.git.zhengqi.arch@bytedance.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Qi Zheng For architectures that define __HAVE_ARCH_TLB_REMOVE_TABLE, the page tables at the pmd/pud level are generally not of struct ptdesc type, and do not have pt_rcu_head member, thus these architectures cannot support PT_RECLAIM. In preparation for enabling PT_RECLAIM on more architectures, convert __HAVE_ARCH_TLB_REMOVE_TABLE to CONFIG_HAVE_ARCH_TLB_REMOVE_TABLE config, so that we can make conditional judgments in Kconfig. Signed-off-by: Qi Zheng Acked-by: Andreas Larsson #sparc Acked-by: David Hildenbrand (Arm) Tested-by: Andreas Larsson #sparc --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/tlb.h | 1 - arch/sparc/Kconfig | 1 + arch/sparc/include/asm/tlb_64.h | 1 - include/asm-generic/tlb.h | 2 +- mm/Kconfig | 3 +++ 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 9537a61ebae02..b47aa8fd62742 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -304,6 +304,7 @@ config PPC select LOCK_MM_AND_FIND_VMA select MMU_GATHER_PAGE_SIZE select MMU_GATHER_RCU_TABLE_FREE + select HAVE_ARCH_TLB_REMOVE_TABLE select MMU_GATHER_MERGE_VMAS select MMU_LAZY_TLB_SHOOTDOWN if PPC_BOOK3S_64 select MODULES_USE_ELF_RELA diff --git a/arch/powerpc/include/asm/tlb.h b/arch/powerpc/include/asm/tlb.h index 2058e8d3e0138..1ca7d4c4b90db 100644 --- a/arch/powerpc/include/asm/tlb.h +++ b/arch/powerpc/include/asm/tlb.h @@ -37,7 +37,6 @@ extern void tlb_flush(struct mmu_gather *tlb); */ #define tlb_needs_table_invalidate() radix_enabled() =20 -#define __HAVE_ARCH_TLB_REMOVE_TABLE /* Get the generic bits... */ #include =20 diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index a630d373e6453..25fa2908d6152 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -74,6 +74,7 @@ config SPARC64 select HAVE_KRETPROBES select HAVE_KPROBES select MMU_GATHER_RCU_TABLE_FREE if SMP + select HAVE_ARCH_TLB_REMOVE_TABLE if SMP select MMU_GATHER_MERGE_VMAS select MMU_GATHER_NO_FLUSH_CACHE select HAVE_ARCH_TRANSPARENT_HUGEPAGE diff --git a/arch/sparc/include/asm/tlb_64.h b/arch/sparc/include/asm/tlb_6= 4.h index 1a6e694418e39..3037187482db7 100644 --- a/arch/sparc/include/asm/tlb_64.h +++ b/arch/sparc/include/asm/tlb_64.h @@ -33,7 +33,6 @@ void flush_tlb_pending(void); #define tlb_needs_table_invalidate() (false) #endif =20 -#define __HAVE_ARCH_TLB_REMOVE_TABLE #include =20 #endif /* _SPARC64_TLB_H */ diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index 4d679d2a206b4..3427b8036ba33 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h @@ -213,7 +213,7 @@ struct mmu_table_batch { #define MAX_TABLE_BATCH \ ((PAGE_SIZE - sizeof(struct mmu_table_batch)) / sizeof(void *)) =20 -#ifndef __HAVE_ARCH_TLB_REMOVE_TABLE +#ifndef CONFIG_HAVE_ARCH_TLB_REMOVE_TABLE static inline void __tlb_remove_table(void *table) { struct ptdesc *ptdesc =3D (struct ptdesc *)table; diff --git a/mm/Kconfig b/mm/Kconfig index a992f2203eb91..456e9eaedca39 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -1451,6 +1451,9 @@ config ARCH_HAS_USER_SHADOW_STACK The architecture has hardware support for userspace shadow call stacks (eg, x86 CET, arm64 GCS or RISC-V Zicfiss). =20 +config HAVE_ARCH_TLB_REMOVE_TABLE + def_bool n + config ARCH_SUPPORTS_PT_RECLAIM def_bool n =20 --=20 2.20.1