Re: [PATCH v2] x86/mm/tlb: Remove flush_tlb_info from the stack

From: Andy Lutomirski
Date: Thu Apr 25 2019 - 14:50:49 EST


On Thu, Apr 25, 2019 at 11:08 AM Nadav Amit <namit@xxxxxxxxxx> wrote:
>
> Move flush_tlb_info variables off the stack. This allows to align
> flush_tlb_info to cache-line and avoid potentially unnecessary cache
> line movements. It also allows to have a fixed virtual-to-physical
> translation of the variables, which reduces TLB misses.
>
> Use per-CPU struct for flush_tlb_mm_range() and
> flush_tlb_kernel_range(). Add debug assertions to ensure there are
> no nested TLB flushes that might overwrite the per-CPU data. For
> arch_tlbbatch_flush() use a const struct.
>

I like this version of the patch.