Re: [PATCH] x86: Align TLB invalidation info

From: Nadav Amit
Date: Wed Jan 31 2018 - 15:48:22 EST


Andy Lutomirski <luto@xxxxxxxxxxxxxx> wrote:

>
>
>> On Jan 31, 2018, at 12:11 PM, Nadav Amit <namit@xxxxxxxxxx> wrote:
>>
>> The TLB invalidation info is allocated on the stack, which might cause
>> it to be unaligned. Since this information may be transferred to
>> different cores for TLB shootdown, this might result in an additional
>> cache-line bouncing between the cores.
>>
>> GCC provides a way to deal with it by using
>> __builtin_alloca_with_align(). Use it to avoid the bouncing cache lines.
>
> Eww. How about __aligned?

Err.. Stupid me. For some reason I remembered I tried it and it didnât have
the desired effect, which caused me to assume it does not work for variables
on the stack. Anyhow, it does the work. Iâll submit v2.