Re: [RFC PATCH 5/6] x86/mm/tlb: Flush remote and local TLBs concurrently

Nadav Amit
2019-05-25T08:38:15Z

> On May 25, 2019, at 1:22 AM, Nadav Amit <namit@vmware.com> wrote:
>
> To improve TLB shootdown performance, flush the remote and local TLBs
> concurrently. Introduce flush_tlb_multi() that does so. The current
> flush_tlb_others() interface is kept, since paravirtual interfaces need
> to be adapted first before it can be removed. This is left for future
> work. In such PV environments, TLB flushes are not performed, at this
> time, concurrently.
>
> +void native_flush_tlb_multi(const struct cpumask *cpumask,
> + const struct flush_tlb_info *info)
> {
> + /*
> + * native_flush_tlb_multi() can handle a single CPU, but it is
> + * suboptimal if the local TLB should be flushed, and therefore should
> + * not be used in such case. Check that it is not used in such case,
> + * and use this assumption for tracing and accounting of remote TLB
> + * flushes.
> + */
> + VM_WARN_ON(!cpumask_any_but(cpumask, smp_processor_id()));

This warning might fire off incorrectly and will be removed.