From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C9B23CCD184 for ; Sat, 18 Oct 2025 09:53:16 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4cpcSp66hCz30Pl; Sat, 18 Oct 2025 20:53:14 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2600:3c0a:e001:78e:0:1991:8:25" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1760781194; cv=none; b=jeZW8ShsQLUKt5jeLMFugrJ7AfpkVO08abaDNT1w8SbGpGUY+M8wG2wRNYAJ57QS3mWE5OnUzTnCndD3s1ABO/5Q3WCLt+JrsD482e+AmI0KfalOm+CeAVjG4YN2EoNQuHaLUnMQwKZoOwQphez1sH5PAStjBT7sfuTZ068BUZteaj+fImbN5peby6w/qs3+IIDQabAXyNtHRN0VDZBYy9+i2XoV13Z4CAYnPu6Jk6agaxkfgKhZ+uBAY5a2aAmytCk6TzBk9I6J+q6yEO6PeYzVfvmcHfd8W3vThool9VR7vEYWU/2LDbHocZJTDtQ4PQOtyZAu1G/9k1imNyIQuA== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1760781194; c=relaxed/relaxed; bh=a5m34w+YJySeDMAg4oYbPewI29W2a9gKFrrQ6A/Z98U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=V/jiZdyBgIn7HKDvq3tEc0xJVT+5arYJLS0+FrKcBkYkEZ3CCeOVoF63g5F0TiBt8X7hEe98xbgejVq0wE1Y3Q88FNdccYA544AiT4Kk9JjJodgSB6N0m32k6pjNYTJ7JcDxXBPvreaoJ+PGVD/LAb6Rdef/gQutp4TaaftLO2DPy6bzJsQw2WbDbLXUCLvNgr3/xN7tYXn/53FjDc43jlcGRtkaCzEtHq0k00xXHjQIQF5PU53G5wbS5/mzicGAQIVfQpNSr0NrnKZpWvtGsrvd3Sbtcbj4L41rE1+LmistsiYtMmD5irFiCf+d8BQqxBgJYDjMn83P3ocnELTnxw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=PVM7dGcE; dkim-atps=neutral; spf=pass (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=rppt@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=PVM7dGcE; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=rppt@kernel.org; receiver=lists.ozlabs.org) Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4cpcSn5s96z2xQ5 for ; Sat, 18 Oct 2025 20:53:13 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id A913045000; Sat, 18 Oct 2025 09:53:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A979DC113D0; Sat, 18 Oct 2025 09:52:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760781190; bh=bOSmYzha9caq7PhodKTKcCoPiLt+2LlIcLfZyClR6tI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PVM7dGcEYXCuz8kq+FQlif5GkokSxvCHTzAFAGwTnR8/6weD/vKEUQASmePsYFC3h +euqjGf0PMyAFk0ZJUt5YM7wZxnuKR0UvscN4IWjm71nso3T24TfhImRIqQfyI4ss6 cv+7XmuLUObCGPTep6i88M7y6u+ifbhyfVbe1BHS4zD5ALzPNDk/kx15zhKRwL0t27 dMmFhLM5KTioGdUJieNshqGCPzeMSFbHvJviFEJxzNeYiuG1A5BFkxDb8ilKL2vLrA 8jv3n05kf1if0vj2NPnC/QhhCj3HuD1WtyN73Zhx+EyOOZxPqW3faoSHxWvYSohg6r KlyEFQZJR/qhA== Date: Sat, 18 Oct 2025 12:52:55 +0300 From: Mike Rapoport To: Kevin Brodsky Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Alexander Gordeev , Andreas Larsson , Andrew Morton , Boris Ostrovsky , Borislav Petkov , Catalin Marinas , Christophe Leroy , Dave Hansen , David Hildenbrand , "David S. Miller" , "H. Peter Anvin" , Ingo Molnar , Jann Horn , Juergen Gross , "Liam R. Howlett" , Lorenzo Stoakes , Madhavan Srinivasan , Michael Ellerman , Michal Hocko , Nicholas Piggin , Peter Zijlstra , Ryan Roberts , Suren Baghdasaryan , Thomas Gleixner , Vlastimil Babka , Will Deacon , Yeoreum Yun , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org Subject: Re: [PATCH v3 05/13] mm: introduce CONFIG_ARCH_LAZY_MMU Message-ID: References: <20251015082727.2395128-1-kevin.brodsky@arm.com> <20251015082727.2395128-6-kevin.brodsky@arm.com> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251015082727.2395128-6-kevin.brodsky@arm.com> On Wed, Oct 15, 2025 at 09:27:19AM +0100, Kevin Brodsky wrote: > Architectures currently opt in for implementing lazy_mmu helpers by > defining __HAVE_ARCH_ENTER_LAZY_MMU_MODE. > > In preparation for introducing a generic lazy_mmu layer that will > require storage in task_struct, let's switch to a cleaner approach: > instead of defining a macro, select a CONFIG option. > > This patch introduces CONFIG_ARCH_LAZY_MMU and has each arch select > it when it implements lazy_mmu helpers. > __HAVE_ARCH_ENTER_LAZY_MMU_MODE is removed and > relies on the new CONFIG instead. > > On x86, lazy_mmu helpers are only implemented if PARAVIRT_XXL is > selected. This creates some complications in arch/x86/boot/, because > a few files manually undefine PARAVIRT* options. As a result > does not define the lazy_mmu helpers, but this > breaks the build as only defines them if > !CONFIG_ARCH_LAZY_MMU. There does not seem to be a clean way out of > this - let's just undefine that new CONFIG too. > > Signed-off-by: Kevin Brodsky > --- ... > @@ -231,7 +231,7 @@ static inline int pmd_dirty(pmd_t pmd) > * held, but for kernel PTE updates, no lock is held). Nesting is not permitted > * and the mode cannot be used in interrupt context. > */ > -#ifndef __HAVE_ARCH_ENTER_LAZY_MMU_MODE > +#ifndef CONFIG_ARCH_LAZY_MMU > static inline void arch_enter_lazy_mmu_mode(void) {} > static inline void arch_leave_lazy_mmu_mode(void) {} > static inline void arch_flush_lazy_mmu_mode(void) {} > diff --git a/mm/Kconfig b/mm/Kconfig > index 0e26f4fc8717..2fdcb42ca1a1 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -1372,6 +1372,9 @@ config PT_RECLAIM > config FIND_NORMAL_PAGE > def_bool n > > +config ARCH_LAZY_MMU > + bool > + I think a better name would be ARCH_HAS_LAZY_MMU and the config option fits better to arch/Kconfig. > source "mm/damon/Kconfig" > > endmenu > -- > 2.47.0 > -- Sincerely yours, Mike.