[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <074ff6ab-5868-4fde-b5bb-9e17632ad817-agordeev@linux.ibm.com>
Date: Fri, 5 Sep 2025 17:52:43 +0200
From: Alexander Gordeev <agordeev@...ux.ibm.com>
To: Kevin Brodsky <kevin.brodsky@....com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Andreas Larsson <andreas@...sler.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Borislav Petkov <bp@...en8.de>,
Catalin Marinas <catalin.marinas@....com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Dave Hansen <dave.hansen@...ux.intel.com>,
David Hildenbrand <david@...hat.com>,
"David S. Miller" <davem@...emloft.net>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
Jann Horn <jannh@...gle.com>, Juergen Gross <jgross@...e.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Madhavan Srinivasan <maddy@...ux.ibm.com>,
Michael Ellerman <mpe@...erman.id.au>, Michal Hocko <mhocko@...e.com>,
Mike Rapoport <rppt@...nel.org>, Nicholas Piggin <npiggin@...il.com>,
Peter Zijlstra <peterz@...radead.org>,
Ryan Roberts <ryan.roberts@....com>,
Suren Baghdasaryan <surenb@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>, Vlastimil Babka <vbabka@...e.cz>,
Will Deacon <will@...nel.org>, linux-arm-kernel@...ts.infradead.org,
linuxppc-dev@...ts.ozlabs.org, sparclinux@...r.kernel.org,
xen-devel@...ts.xenproject.org
Subject: Re: [PATCH 5/7] powerpc/mm: support nested lazy_mmu sections
On Thu, Sep 04, 2025 at 01:57:34PM +0100, Kevin Brodsky wrote:
...
> static inline lazy_mmu_state_t arch_enter_lazy_mmu_mode(void)
> {
> struct ppc64_tlb_batch *batch;
> + int lazy_mmu_nested;
>
> if (radix_enabled())
> return LAZY_MMU_DEFAULT;
> @@ -39,9 +40,14 @@ static inline lazy_mmu_state_t arch_enter_lazy_mmu_mode(void)
> */
> preempt_disable();
> batch = this_cpu_ptr(&ppc64_tlb_batch);
> - batch->active = 1;
> + lazy_mmu_nested = batch->active;
>
> - return LAZY_MMU_DEFAULT;
> + if (!lazy_mmu_nested) {
Why not just?
if (!batch->active) {
> + batch->active = 1;
> + return LAZY_MMU_DEFAULT;
> + } else {
> + return LAZY_MMU_NESTED;
> + }
> }
>
> static inline void arch_leave_lazy_mmu_mode(lazy_mmu_state_t state)
> @@ -54,7 +60,10 @@ static inline void arch_leave_lazy_mmu_mode(lazy_mmu_state_t state)
>
> if (batch->index)
> __flush_tlb_pending(batch);
> - batch->active = 0;
> +
> + if (state != LAZY_MMU_NESTED)
> + batch->active = 0;
> +
> preempt_enable();
> }
Thanks!
Powered by blists - more mailing lists