[PATCH v2] arm64: tlbflush: Don't broadcast if mm was only active on local cpu
Will Deacon
will at kernel.org
Sun Jun 14 04:33:07 PDT 2026
On Sun, Jun 14, 2026 at 12:04:44PM +0100, Will Deacon wrote:
> Can you simplify the 'if' condition here?
>
> if (active == ACTIVE_CPU_NONE) {
> if (!try_cmpxchg_relaxed(...))
> WRITE_ONCE(...);
>
> dsb(ishst);
> }
>
> (as an aside, maybe we should implement arch_try_cmpxchg{,_relaxed} so
> we could drop the READ_ONCE() here as well?)
Mulling this over a little more, we probably can't drop the READ_ONCE()
even if we optimised our try_cmpxchg() implementation, as it would
prevent us from eliding the DSB on the fast path.
The rest of my comments (including the refactoring above) stand, however.
Will
More information about the linux-arm-kernel
mailing list