Re: [PATCH v6 10/12] x86/mm: Move flush_tlb_info back to the stack
From: Chuyi Zhou
Date: Thu Jun 04 2026 - 22:57:40 EST
On 2026-06-05 5:21 a.m., Nadav Amit wrote:
>
>
>> On 5 Jun 2026, at 0:16, Dave Hansen <dave.hansen@xxxxxxxxx> wrote:
>>
>> On 6/4/26 14:11, Nadav Amit wrote:
>>>
>>> That's what led us to move flush_tlb_info into a per-cpu struct (preemption
>>> was disabled at that time, so there was no trade-off). Now that Zhou claims
>>> that disabling the preemption is a pain-point, and therefore does not want
>>> to set flush_tlb_info per-cpu, the solution we've landed on is to put it back
>>> on the stack - avoiding the need for a single flush_tlb_info that depends on
>>> preemption being disabled — while limiting the alignment to 64 bytes so the
>>> stack doesn't grow out of control.
>>
>> OK, cool. That's great info for a Link: tag. It also seems like you're
>> happy with this, so would a ack/review tag be appropriate to provide?
>
> Ack tag is fine with me (there’s already suggested-by tag). For reviewed-by
> I should look a bit more thoroughly...
Thanks Dave and Nadav.
Yes, I agree the changelog should be reworded. I did not mean to
question Nadav's original patch or the benchmark methodology. The
per-cpu storage made sense when preemption was disabled, especially
after the earlier stack-growth issue with cacheline-aligned on-stack
storage.
I will update the changelog to describe that history explicitly: the
old stack-aligned version could grow the stack too much on some configs,
which led to the per-cpu storage, while this series needs to remove the
single per-cpu flush_tlb_info dependency as preparation for shortening
the preemption-disabled window. The proposed compromise is to put it
back on the stack, but cap the alignment at 64 bytes.
I will also split this into smaller patches in v7:
1. refactor the flush_tlb_info helper so initialization can use
caller-provided storage, without changing the current per-cpu
storage;
2. add the capped alignment for struct flush_tlb_info;
3. move the actual flush_tlb_info storage from per-cpu back to the
stack.
Nadav, thanks for the ack. I will add this in the next version.