[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/7] mm: remove arch_flush_lazy_mmu_mode()


  • To: Kevin Brodsky <kevin.brodsky@xxxxxxx>
  • From: Yeoreum Yun <yeoreum.yun@xxxxxxx>
  • Date: Mon, 8 Sep 2025 10:29:58 +0100
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=kvack.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vOUWWA/OEL3p0X7QghuOVP3ekc85NorR1xQs8c+jbtE=; b=QfXAAzycbnFV0ohmdZkanrjEfvt8XiiVf8p87d3+aMzSv4X2YBnHGrYeSxWDK71Tj7HsZ+TqiEnqswrU3qf+QUG/+ZXvl9dfQjmgPfE5jhACYVcKk+uzVPLNgOU90CpqqjznoiYf4w7P4+xoDrMXiEP33OFfbdimg3So8p0AB8DFX+U7Ml2IZ8bjCCmsfms+QFikwFvsRq+KmNUFM/ArRJYsAIfOU7IMiwOZtc7pOU7vekMMgylMucE+87CEnZ8GO+/gy9iJ83HWoku3kSGmF7ZtNasa0YiQBBp+kvHJYhYiQdxDLY+Tgth7wtb4CeDDSJaiQQ3BNTLbv0dp2EkPIQ==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vOUWWA/OEL3p0X7QghuOVP3ekc85NorR1xQs8c+jbtE=; b=NUtcRawChS5qDt8PnMtuLkR7MJj30sNUZxcPsJ77C35mpsOPVYrUbOx6zpJ6udsxPA62SnMtndz8sfgJOynqlOEuO8hD/9O6ulLFt4kmaKvY3iNSNPprw+3qo8KlrDjKcf34TusnQsbhon6MjJPtrRYV5dPl8b1SfSB6yzSx/FWNAKSpOfoqv+Gdmh2NjSlsjFvBQtiPGhZJSqNSdf+6pptFc8PMZt//FdBDqKyAhIPGINFEyycGhKJ6v2sCwRVQ5p4i/2UBqKlE7CUhtIbT33DniBxcNQJVtmGmN+1Pvg4U2SXBa6TbEf73dYZCVzipw/f1jq2qM/vz4KKYEZ5poQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=iGpmBvfufjmOJ3JFsg1iU8dH7VRNNQK5puR6tGHMSABfhyBYpT31H6j6gFscbC7woUa4R3VBOUdmB/oaW+sYBJsknYcLi/8Owefx3D0OdF/BB6zdwwfi8S9OHHrjE7mVQswC1UmYKfC3HYn+hhJoUyjK3J4QtSktf0ue0hCLeaGwtzeHX0HZYUBZYjlxA+xe2pYaWtNby0VtQ6bCoGlDDNdlYr47qpK1Ik70fb6fy27ZfzsHwzjR8Out/qVyz51ViOPXXZTQxMirbn7GQKE7KP5ZTOIfoMWUykGamwbK3+IzPBx9sxUZNyHSmYz7vrDOTym9eSktXO9n1mHdfOPh7A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xoX2Dbq0kHw/BHmBV26uWb8hs95iiOCAj2a/rJpBuDMhN5dL/Ssziqb9zeIM9/waLCHYvGCrfKduV7Fmj8Tz4DJquXymLD38rlPneK9YfMBp/1kaE0zUdu4kRGwkCmxPA/EkjPWwPfYh0PWEmj8zRlptjuQlzcJ2rv8b6g+hstvfkEbDA0HFIHZGuo+fs9kxcwsSArm8PEdNBBaKcWTVT5VrI9RbCbRiEJmTwaqsTPk1ejUguWNbI0rRnK0dM8r4gTaNNLB22opFnIsDsycbYdhA2wYIFkXNWYLWaBm2OmJ1/qEx06s6KZpRxmN+opw7wYEGmaHZSh4WKiyV8Y8i7g==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: linux-mm@xxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Alexander Gordeev <agordeev@xxxxxxxxxxxxx>, Andreas Larsson <andreas@xxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, Christophe Leroy <christophe.leroy@xxxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Jann Horn <jannh@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, "Liam R. Howlett" <Liam.Howlett@xxxxxxxxxx>, Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>, Madhavan Srinivasan <maddy@xxxxxxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Michal Hocko <mhocko@xxxxxxxx>, Mike Rapoport <rppt@xxxxxxxxxx>, Nicholas Piggin <npiggin@xxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Ryan Roberts <ryan.roberts@xxxxxxx>, Suren Baghdasaryan <surenb@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Vlastimil Babka <vbabka@xxxxxxx>, Will Deacon <will@xxxxxxxxxx>, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 08 Sep 2025 09:31:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

Reviewed-by: Yeoreum Yun <yeoreum.yun@xxxxxxx>

On Mon, Sep 08, 2025 at 08:39:25AM +0100, Kevin Brodsky wrote:
> This function has only ever been used in arch/x86, so there is no
> need for other architectures to implement it. Remove it from
> linux/pgtable.h and all architectures besides x86.
>
> The arm64 implementation is not empty but it is only called from
> arch_leave_lazy_mmu_mode(), so we can simply fold it there.
>
> Acked-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
> Signed-off-by: Kevin Brodsky <kevin.brodsky@xxxxxxx>
> ---
>  arch/arm64/include/asm/pgtable.h                   | 9 +--------
>  arch/powerpc/include/asm/book3s/64/tlbflush-hash.h | 2 --
>  arch/sparc/include/asm/tlbflush_64.h               | 1 -
>  arch/x86/include/asm/pgtable.h                     | 3 ++-
>  include/linux/pgtable.h                            | 1 -
>  5 files changed, 3 insertions(+), 13 deletions(-)
>
> diff --git a/arch/arm64/include/asm/pgtable.h 
> b/arch/arm64/include/asm/pgtable.h
> index abd2dee416b3..728d7b6ed20a 100644
> --- a/arch/arm64/include/asm/pgtable.h
> +++ b/arch/arm64/include/asm/pgtable.h
> @@ -101,21 +101,14 @@ static inline void arch_enter_lazy_mmu_mode(void)
>       set_thread_flag(TIF_LAZY_MMU);
>  }
>
> -static inline void arch_flush_lazy_mmu_mode(void)
> +static inline void arch_leave_lazy_mmu_mode(void)
>  {
>       if (in_interrupt())
>               return;
>
>       if (test_and_clear_thread_flag(TIF_LAZY_MMU_PENDING))
>               emit_pte_barriers();
> -}
> -
> -static inline void arch_leave_lazy_mmu_mode(void)
> -{
> -     if (in_interrupt())
> -             return;
>
> -     arch_flush_lazy_mmu_mode();
>       clear_thread_flag(TIF_LAZY_MMU);
>  }
>
> diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h 
> b/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h
> index 146287d9580f..176d7fd79eeb 100644
> --- a/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h
> +++ b/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h
> @@ -55,8 +55,6 @@ static inline void arch_leave_lazy_mmu_mode(void)
>       preempt_enable();
>  }
>
> -#define arch_flush_lazy_mmu_mode()      do {} while (0)
> -
>  extern void hash__tlbiel_all(unsigned int action);
>
>  extern void flush_hash_page(unsigned long vpn, real_pte_t pte, int psize,
> diff --git a/arch/sparc/include/asm/tlbflush_64.h 
> b/arch/sparc/include/asm/tlbflush_64.h
> index 8b8cdaa69272..cd144eb31bdd 100644
> --- a/arch/sparc/include/asm/tlbflush_64.h
> +++ b/arch/sparc/include/asm/tlbflush_64.h
> @@ -44,7 +44,6 @@ void flush_tlb_kernel_range(unsigned long start, unsigned 
> long end);
>  void flush_tlb_pending(void);
>  void arch_enter_lazy_mmu_mode(void);
>  void arch_leave_lazy_mmu_mode(void);
> -#define arch_flush_lazy_mmu_mode()      do {} while (0)
>
>  /* Local cpu only.  */
>  void __flush_tlb_all(void);
> diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
> index e33df3da6980..14fd672bc9b2 100644
> --- a/arch/x86/include/asm/pgtable.h
> +++ b/arch/x86/include/asm/pgtable.h
> @@ -117,7 +117,8 @@ extern pmdval_t early_pmd_flags;
>  #define pte_val(x)   native_pte_val(x)
>  #define __pte(x)     native_make_pte(x)
>
> -#define arch_end_context_switch(prev)        do {} while(0)
> +#define arch_end_context_switch(prev)        do {} while (0)
> +#define arch_flush_lazy_mmu_mode()   do {} while (0)
>  #endif       /* CONFIG_PARAVIRT_XXL */
>
>  static inline pmd_t pmd_set_flags(pmd_t pmd, pmdval_t set)
> diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
> index 94249e671a7e..8d6007123cdf 100644
> --- a/include/linux/pgtable.h
> +++ b/include/linux/pgtable.h
> @@ -234,7 +234,6 @@ static inline int pmd_dirty(pmd_t pmd)
>  #ifndef __HAVE_ARCH_ENTER_LAZY_MMU_MODE
>  #define arch_enter_lazy_mmu_mode()   do {} while (0)
>  #define arch_leave_lazy_mmu_mode()   do {} while (0)
> -#define arch_flush_lazy_mmu_mode()   do {} while (0)
>  #endif
>
>  #ifndef pte_batch_hint
> --
> 2.47.0
>

--
Sincerely,
Yeoreum Yun



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.