Re: [PATCH v5 3/8] x86/mm/tlb: Open-code on_each_cpu_cond_mask() for tlb_is_not_lazy()

2021-02-18 Thread Christoph Hellwig
On Thu, Feb 18, 2021 at 08:24:23AM +, Nadav Amit wrote: > In general, thanks for the feedback (I will reply after I follow your > feedback). I do have a general question - I thought it was decided that > clarity should be preferred over following the 80-column limit. Please let > me know if I m

Re: [PATCH v5 3/8] x86/mm/tlb: Open-code on_each_cpu_cond_mask() for tlb_is_not_lazy()

2021-02-18 Thread Nadav Amit
> On Feb 18, 2021, at 12:16 AM, Christoph Hellwig wrote: > > On Tue, Feb 09, 2021 at 02:16:48PM -0800, Nadav Amit wrote: >> +/* >> + * Although we could have used on_each_cpu_cond_mask(), >> + * open-coding it has performance advantages, as it eliminates >> +

Re: [PATCH v5 3/8] x86/mm/tlb: Open-code on_each_cpu_cond_mask() for tlb_is_not_lazy()

2021-02-18 Thread Christoph Hellwig
On Tue, Feb 09, 2021 at 02:16:48PM -0800, Nadav Amit wrote: > + /* > + * Although we could have used on_each_cpu_cond_mask(), > + * open-coding it has performance advantages, as it eliminates > + * the need for indirect calls or retpolines. In addi

[PATCH v5 3/8] x86/mm/tlb: Open-code on_each_cpu_cond_mask() for tlb_is_not_lazy()

2021-02-09 Thread Nadav Amit
From: Nadav Amit Open-code on_each_cpu_cond_mask() in native_flush_tlb_others() to optimize the code. Open-coding eliminates the need for the indirect branch that is used to call is_lazy(), and in CPUs that are vulnerable to Spectre v2, it eliminates the retpoline. In addition, it allows to use a