Re: [PATCH] x86,tlb: update mm_cpumask lazily
From: Dave Hansen
Date: Fri Nov 08 2024 - 15:03:25 EST
On 11/8/24 11:31, Rik van Riel wrote:
> /* Start receiving IPIs and then read tlb_gen (and LAM below) */
> - if (next != &init_mm)
> + if (next != &init_mm && !cpumask_test_cpu(cpu, mm_cpumask(next)))
> cpumask_set_cpu(cpu, mm_cpumask(next));
> next_tlb_gen = atomic64_read(&next->context.tlb_gen);
If we're worried about contention on mm_cpumask(), then this hunk makes
sense independently of the lazy updating. We might want to take this
hunk forward before we do the rest because this seems like a no-brainer.