Re: [PATCH v4 2/8] alpha: run check_mmu_context() from finish_arch_post_lock_switch()
From: Matt Turner
Date: Fri Oct 09 2026 - 21:43:22 EST
On Fri, Oct 09, 2026 at 11:03:47PM +0200, Magnus Lindholm wrote:
> +/* Alpha has no kernel preemption; these callers cannot migrate here. */
Nothing in the file says who "these callers" are. Something like:
/*
* Also called from kthread_use_mm() with preemption enabled. Alpha has
* no kernel preemption, so the task is still on the CPU that ran
* switch_mm().
*/
> + /* A deferred shootdown can also invalidate a newly allocated ASN. */
> + cpu_data[cpu].need_new_asn = 1;
That closes the zero-slot case. I went through the window again with
this in place. An IPI that sees asn_lock zeroes the slot and the hook
reloads. One that arrives after asn_lock is cleared flushes the
context PAL_swpctx already loaded, and the hook finds the slot nonzero.
The hook's __load_new_mm_context() now runs with interrupts on, so an
IPI can nest inside it. Both are loading the same mm, so the worst
outcome is that it gets the same ASN twice. flush_tlb_mm() from process
context has always had that.
Reviewed-by: Matt Turner <mattst88@xxxxxxxxx>