Re: [PATCH v2 2/3] alpha: do not clear remote MMU contexts in migrate_flush_tlb_page()
From: Matt Turner
Date: Thu Oct 08 2026 - 17:21:30 EST
On Thu, Oct 8, 2026 at 3:56 PM Magnus Lindholm <linmag7@xxxxxxxxx> wrote:
>
> After the on_each_cpu() rendezvous, migrate_flush_tlb_page() walks the
> other CPUs and zeroes their mm->context[cpu] when mm_users is at most one,
> described as mimicking flush_tlb_mm()'s mm_users<=1 optimization.
>
> It is not one. flush_tlb_mm() tests mm_users before deciding whether to
> send the IPIs; here every CPU has already been visited and waited for, so
> nothing is saved. The callback has also just set each CPU's own slot
> correctly, so the loop only overwrites it, and does so while that CPU may
> still be running in the address space.
>
> Remove it. The shootdown shortcuts in flush_tlb_mm(), flush_tlb_page()
> and flush_icache_user_page() clear remote slots too; once the next patch
> removes those as well, every runtime update of mm->context[cpu] is made by
> CPU cpu itself. That patch relies on the invariant when it reads those
> slots to decide whether a shootdown can be skipped, so this one is tagged
> for stable as its prerequisite.
>
> Fixes: dd5712f3379c ("alpha: fix user-space corruption during memory compaction")
> Cc: <stable@xxxxxxxxxxxxxxx>
> Signed-off-by: Magnus Lindholm <linmag7@xxxxxxxxx>
Reviewed-by: Matt Turner <mattst88@xxxxxxxxx>