Re: [PATCH v5 2/2] x86/mm: Improve TLB flush documentation
From: Peter Zijlstra
Date: Tue Jul 25 2017 - 06:02:58 EST
On Mon, Jul 24, 2017 at 09:41:39PM -0700, Andy Lutomirski wrote:
> + /*
> + * Resume remote flushes and then read tlb_gen. The
> + * implied barrier in atomic64_read() synchronizes
There is no barrier in atomic64_read().
> + * with inc_mm_tlb_gen() like this:
> + *
> + * switch_mm_irqs_off(): flush request:
> + * cpumask_set_cpu(...); inc_mm_tlb_gen();
> + * MB MB
> + * atomic64_read(.tlb_gen); flush_tlb_others(mm_cpumask());
> + */
> cpumask_set_cpu(cpu, mm_cpumask(next));
> next_tlb_gen = atomic64_read(&next->context.tlb_gen);
>