Re: [PATCH v4 2/2] alpha: do not skip TLB shootdown IPIs for kthread-borrowed mms
From: Matt Turner
Date: Sat Oct 10 2026 - 19:34:54 EST
On Sat, Oct 10, 2026 at 16:33 +0200, Magnus Lindholm wrote:
> This requires the preceding removal of remote slot clearing from
> migrate_flush_tlb_page(). It also requires the stale-TLB series to set
> need_new_asn on both the reused and newly allocated ASN paths.
[...]
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@xxxxxxxxxxxxxxx
With that Fixes tag this will be tried on every stable tree, and the
dependency is only in the prose. The hunk context includes comments the
stale-TLB series adds, so it will fail to apply rather than misapply,
which is the safe outcome. Naming the prerequisites on the Cc: stable
line would still save a round of FAILED mails.
> + /*
> + * Ordered before any use of the mm by the mb() in
> + * arch_spin_unlock(), when finish_lock_switch() drops
> + * the rq lock.
> + */
> + WRITE_ONCE(next_mm->context[cpu], mmc);
"Any use of the mm" is slightly too strong: swpctx loads the new ptbr
and ASN in switch_to(), before the unlock. What the ordering has to
precede is the first TLB fill for a user address, so maybe:
/*
* Ordered before any user access through the mm by the
* mb() in arch_spin_unlock(), when finish_lock_switch()
* drops the rq lock.
*/
Fine as a fixup, no need for a v5 on my account.
> + if (atomic_read(&mm->mm_users) <= 1 &&
> + !mm_context_elsewhere(mm)) {
Not for this series: once every slot has a single writer, I think the
slot test is sufficient by itself and mm_users only narrows the
shortcut. Dropping it later would extend the shortcut to a
multithreaded process whose threads all sit on one CPU. Worth a look
after this has had some soak time.
Nit: the changelog paragraph starting "Order the slot reads" has a short
line at "Also issue smp_mb() after" that wants refilling.