[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yf12lXHtPVXgAoFL@arm.com>
Date: Fri, 4 Feb 2022 18:55:17 +0000
From: Catalin Marinas <catalin.marinas@....com>
To: Valentin Schneider <valentin.schneider@....com>
Cc: linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rt-users@...r.kernel.org,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Will Deacon <will@...nel.org>, Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Steven Rostedt <rostedt@...dmis.org>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
Frederic Weisbecker <frederic@...nel.org>,
Josh Triplett <josh@...htriplett.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Davidlohr Bueso <dave@...olabs.net>,
Lai Jiangshan <jiangshanlai@...il.com>,
Joel Fernandes <joel@...lfernandes.org>,
Anshuman Khandual <anshuman.khandual@....com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Steven Price <steven.price@....com>,
Ard Biesheuvel <ardb@...nel.org>,
Boqun Feng <boqun.feng@...il.com>,
Mike Galbraith <efault@....de>
Subject: Re: [PATCH v4] arm64: mm: Make arch_faults_on_old_pte() check for
migratability
On Thu, Jan 27, 2022 at 07:24:37PM +0000, Valentin Schneider wrote:
> arch_faults_on_old_pte() relies on the calling context being
> non-preemptible. CONFIG_PREEMPT_RT turns the PTE lock into a sleepable
> spinlock, which doesn't disable preemption once acquired, triggering the
> warning in arch_faults_on_old_pte().
>
> It does however disable migration, ensuring the task remains on the same
> CPU during the entirety of the critical section, making the read of
> cpu_has_hw_af() safe and stable.
>
> Make arch_faults_on_old_pte() check cant_migrate() instead of preemptible().
>
> Suggested-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> Signed-off-by: Valentin Schneider <valentin.schneider@....com>
> Link: https://lore.kernel.org/r/20210811201354.1976839-5-valentin.schneider@arm.com
> ---
> v3 -> v4: Dropped migratable(), reuse cant_migrate() (Sebastian)
> ---
> arch/arm64/include/asm/pgtable.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
> index c4ba047a82d2..3caf6346ea95 100644
> --- a/arch/arm64/include/asm/pgtable.h
> +++ b/arch/arm64/include/asm/pgtable.h
> @@ -1001,7 +1001,8 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
> */
> static inline bool arch_faults_on_old_pte(void)
> {
> - WARN_ON(preemptible());
> + /* The register read below requires a stable CPU to make any sense */
> + cant_migrate();
>
> return !cpu_has_hw_af();
> }
The patch looks alright but what's the plan with it? Does it go into the
preempt-rt tree, mainline? It's not a fix to be queued now, so:
Acked-by: Catalin Marinas <catalin.marinas@....com>
Powered by blists - more mailing lists