From: Alexander Gordeev <agordeev@linux.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
sparclinux@vger.kernel.org, xen-devel@lists.xenproject.org,
linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
Hugh Dickins <hughd@google.com>,
Nicholas Piggin <npiggin@gmail.com>,
Guenter Roeck <linux@roeck-us.net>,
Juergen Gross <jgross@suse.com>,
Jeremy Fitzhardinge <jeremy@goop.org>,
Ryan Roberts <ryan.roberts@arm.com>
Subject: [PATCH 5/6] powerpc/64s: Do not disable preemption in lazy MMU mode
Date: Thu, 12 Jun 2025 19:36:12 +0200 [thread overview]
Message-ID: <448f6e26a9d72fb2c873245ea948807491f6b798.1749747752.git.agordeev@linux.ibm.com> (raw)
In-Reply-To: <cover.1749747752.git.agordeev@linux.ibm.com>
Commit b9ef323ea168 ("powerpc/64s: Disable preemption in hash lazy
mmu mode") is not necessary anymore, since the lazy MMU mode is
entered with a spinlock held and powerpc does not support Real-Time.
Thus, upon entering the lazy mode the preemption is already disabled.
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
---
arch/powerpc/include/asm/book3s/64/tlbflush-hash.h | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h b/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h
index 146287d9580f..aeac22b576c8 100644
--- a/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h
+++ b/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h
@@ -30,13 +30,9 @@ static inline void arch_enter_lazy_mmu_mode(void)
{
struct ppc64_tlb_batch *batch;
+ VM_WARN_ON_ONCE(preemptible());
if (radix_enabled())
return;
- /*
- * apply_to_page_range can call us this preempt enabled when
- * operating on kernel page tables.
- */
- preempt_disable();
batch = this_cpu_ptr(&ppc64_tlb_batch);
batch->active = 1;
}
@@ -45,6 +41,7 @@ static inline void arch_leave_lazy_mmu_mode(void)
{
struct ppc64_tlb_batch *batch;
+ VM_WARN_ON_ONCE(preemptible());
if (radix_enabled())
return;
batch = this_cpu_ptr(&ppc64_tlb_batch);
@@ -52,10 +49,12 @@ static inline void arch_leave_lazy_mmu_mode(void)
if (batch->index)
__flush_tlb_pending(batch);
batch->active = 0;
- preempt_enable();
}
-#define arch_flush_lazy_mmu_mode() do {} while (0)
+static inline void arch_flush_lazy_mmu_mode(void)
+{
+ VM_WARN_ON_ONCE(preemptible());
+}
extern void hash__tlbiel_all(unsigned int action);
--
2.48.1
next prev parent reply other threads:[~2025-06-12 17:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-12 17:36 [PATCH 0/6] mm: Consolidate lazy MMU mode context Alexander Gordeev
2025-06-12 17:36 ` [PATCH 1/6] mm: Cleanup apply_to_pte_range() routine Alexander Gordeev
2025-06-12 17:36 ` [PATCH 2/6] mm: Lock kernel page tables before entering lazy MMU mode Alexander Gordeev
2025-06-13 8:26 ` Ryan Roberts
2025-06-13 10:32 ` Uladzislau Rezki
2025-06-18 17:32 ` Dan Carpenter
2025-06-19 9:53 ` Uladzislau Rezki
2025-06-12 17:36 ` [PATCH 3/6] mm/debug: Detect wrong arch_enter_lazy_mmu_mode() contexts Alexander Gordeev
2025-06-12 17:36 ` [PATCH 4/6] sparc/mm: Do not disable preemption in lazy MMU mode Alexander Gordeev
2025-06-13 8:40 ` Ryan Roberts
2025-06-12 17:36 ` Alexander Gordeev [this message]
2025-06-12 17:36 ` [PATCH 6/6] powerpc/64s: Do not re-activate batched TLB flush Alexander Gordeev
2025-06-17 15:11 ` Alexander Gordeev
2025-10-03 9:38 ` Kevin Brodsky
2025-10-07 9:40 ` Ritesh Harjani
2025-10-07 14:33 ` 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=448f6e26a9d72fb2c873245ea948807491f6b798.1749747752.git.agordeev@linux.ibm.com \
--to=agordeev@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=jeremy@goop.org \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@gmail.com \
--cc=ryan.roberts@arm.com \
--cc=sparclinux@vger.kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).