From: Naman Jain <[email protected]> Sent: Monday, November 23, 2026 10:45 PM > > On 11/24/2026 5:46 AM, Michael Kelley wrote: > > From: Naman Jain <[email protected]> Sent: Tuesday, November 17, > 2026 1:15 AM > >> > >> SuperBench's eight-GPU PyTorch LSTM training on Azure MI300X VMs regressed > >> between Linux 6.8 and 7.0. Recreating DataLoader workers each epoch caused > >> host-to-GPU copy stalls and timeouts. The reported bisection identified > >> commit 209954cbc7d0 ("x86/mm/tlb: Update mm_cpumask lazily"). > >> > >> That change leaves a CPU's bit set after it switches to another mm. > > > > To be more explicit, > > > > "... leaves a CPU's bit set in the mm_cpumask even after the CPU switches > > to another mm". > > > > Acked. > > >> Native flush callbacks remove these stale bits, but successful Hyper-V > > > > Again, I'm wondering about the "successful" qualifier. > > > > Discussed in patch 3 comments. Please let me know if I can retain this.
I know I'm being a bit pedantic, but perhaps this text: ... but successfully taking the Hyper-V hypercall path does not run those callbacks. > > >> hypercalls do not run those callbacks. A CPU actively running another > > > > The word "actively" seems redundant/superfluous here. > > Acked. I'll remove it. > > > > >> mm need not be in lazy TLB mode, so the existing lazy-TLB check does not > >> exclude it. If the mask includes all present CPUs, the backend selects > > > > Be more explicit than just "backend". > > Acked. > > > > >> the all-processors shortcut before checking individual CPUs. > >> > >> Use the native predicate to build a per-CPU target mask before selecting > > > > Be more explicit than "native predicate" (which sounds like AI-speak). > > Just say should_flush_tlb(). > > Acked. > > > > >> the all-processors shortcut or either hypercall format. Keep the full > >> candidate mask when freeing page tables. Retain the empty basic-mask > >> check because filtering can leave no targets. > >> > >> This patch does not change when trimming is requested. > > > > I had a little trouble parsing this sentence. I first read it as > > "When trimming is requested, this patch does not change.", > > which didn't make any sense. Maybe reword as "This patch > > does not affect when trimming is requested." > > Agreed. > > > > >> > >> Signed-off-by: Naman Jain <[email protected]> > >> --- > >> arch/x86/hyperv/mmu.c | 40 ++++++++++++++++++++++++++-------------- > >> 1 file changed, 26 insertions(+), 14 deletions(-) > >> > > > <snip> > > >> - > >> static void hyperv_flush_tlb_multi(const struct cpumask *cpus, > >> const struct flush_tlb_info *info) > >> { > >> int cpu, vcpu, gva_n, max_gvas; > >> struct hv_tlb_flush *flush; > >> + struct cpumask *flush_cpus; > >> u64 status; > >> unsigned long flags; > >> - bool do_lazy = !info->freed_tables; > >> > >> trace_hyperv_mmu_flush_tlb_multi(cpus, info); > >> > >> @@ -87,6 +85,23 @@ static void hyperv_flush_tlb_multi(const struct cpumask > *cpus, > >> goto do_native; > >> } > >> > >> + flush_cpus = this_cpu_ptr(&hyperv_tlb_flush_mask); > >> + /* > >> + * mm_cpumask() may retain CPUs that have switched to another mm. > >> + * Use the native predicate for its context-switch ordering and lazy > > > > Again, say should_flush_tlb() instead of "native predicate". And I don't > > really know what "context-switch ordering" is trying to get at. > > Please allow me to rewrite this whole comment as follows: > > mm_cpumask() may include CPUs that have switched to another mm. > Use should_flush_tlb() to check which CPUs need this flush. > When freeing page tables, keep the full mask because CPUs in > lazy TLB mode must also be flushed. Looks good to me. Michael > > > > > >> + * TLB exclusion. Page-table freeing must include lazy CPUs, so keep > >> + * the full candidate mask in that case. > >> + */ > >> + if (info->freed_tables) { > >> + cpumask_copy(flush_cpus, cpus); > >> + } else { > >> + cpumask_clear(flush_cpus); > >> + for_each_cpu(cpu, cpus) { > >> + if (should_flush_tlb(cpu, info)) > >> + __cpumask_set_cpu(cpu, flush_cpus); > >> + } > >> + } > >> + > > Regards, > Naman >
