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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D934CCA1016 for ; Fri, 5 Sep 2025 15:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jWjfStJ6xVgrWeWyv/waZRzeET/q2kIvfT9KYMUeqWo=; b=ANByN1KfWwOAclRoYYfqC/+apU cveYKrnii8Xw8fUnle/S3SZH98aNKdHI91EEUJDxY6xU6/h6sya4Ea0SyETi9am6WjHsOozO68QCP IgpSsRhTob16fC5L86eVUPeor8Mv4QeS43X9n+b7v775C0t86Zm9ww06IbR48+Gy/OqgtK7GhjHrc CoWOVClaWnH274su0yzrq1iKR7RFoyJH+U/cwQ00VxMadD35wyLkVJKZHYiA2H/MJ7LIHHimFxxqo 0V3yDtvUINzmp/kRSHovGY3p9SwHuKNkuspDat4vmjyqoAQWrLyWcZcbwesV5JjdFN1ipqiyt60D7 e9c3TqVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uuYYp-00000002pEw-2X24; Fri, 05 Sep 2025 15:41:11 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uuUBl-00000001EUV-065T for linux-arm-kernel@lists.infradead.org; Fri, 05 Sep 2025 11:01:06 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id CACB4442A6; Fri, 5 Sep 2025 11:01:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2257C4CEF1; Fri, 5 Sep 2025 11:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757070063; bh=YZ1wTIYoB930tSA5MeqtdhO0LxdCLchTUQFtsum00QY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U7+DnpZ0s1JKbZszxSjLy0wzG4FuSPqezXeI+JVM+MWhXKMk7hbSMLMR/Ap70xViw Grd6dhed7yIRR8Yu73fJN0N7pkSYFsDBBJo92L9gty0NMlP0j/ofYzR8Udwhhqz0oh CUbTDNzSsrto9aiXPTcXZ/bGs5k+wjoB6qyCquH8g/JPTbP7OqDNsG+bte2OrVpi4n zx6H4iTAqk8cmGshjWzK/jnlqFQq/hJysU/x9N1c9QnwDh2XIGq4oxaydCWq1cwWGV 2fRPyoqYacVZpZfy0SFEibM7KjqfNwOBpyIxsFAfubouuDw7Z5Ombt9MKgcN6WzQfQ 4CK8xb4S08BQg== Date: Fri, 5 Sep 2025 14:00:50 +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 , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, xen-devel@lists.xenproject.org Subject: Re: [PATCH 1/7] mm: remove arch_flush_lazy_mmu_mode() Message-ID: References: <20250904125736.3918646-1-kevin.brodsky@arm.com> <20250904125736.3918646-2-kevin.brodsky@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250904125736.3918646-2-kevin.brodsky@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250905_040105_109300_21826C9E X-CRM114-Status: GOOD ( 23.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Sep 04, 2025 at 01:57:30PM +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. > > Signed-off-by: Kevin Brodsky Acked-by: Mike Rapoport (Microsoft) > --- > 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 4c035637eeb7..8848e132a6be 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 yours, Mike.