Re: [PATCH v10 00/10] x86: Quiesce text_poke() IPIs
From: Mathieu Desnoyers
Date: Mon Nov 30 2026 - 14:31:37 EST
On 2026-11-30 14:15, Steven Rostedt wrote:
> On Mon, 30 Nov 2026 11:04:24 -0800
> Dave Hansen <dave.hansen@xxxxxxxxx> wrote:
>
>> On 11/30/26 10:50, Steven Rostedt wrote:
>>>> A. Get a Meltdown-free CPU.
>>>> Pro: Simpler kernel maintenance forever
>>>> Con: Lots of otherwise-fine CPUs can't avoid the IPIs
>>> I guess my question is why does a Meltdown-free CPU not need the IPIs?
>>
>> Oh, that is a good question. I was forgetting how this thing actually works.
>>
>> I was wrong: meltdown-free CPUs don't get to skip the IPIs. They just
>> don't have to worry about the per-cpu data structures being unmapped
>> when they come back in to the kernel.
>>
>> But there did end up being some substantial complexity with the per-cpu
>> variables to make PTI work correctly. That's the part I was reacting to.
>>
>> My overall reaction is still the same, though: too much pain for too
>> little gain. There has to be a simpler way to do this.
>
> I will say that there's a big demand for this in my new industry where we
> run most our work in user space under NO_HZ mode where people get really
> upset when their applications get interrupted by the kernel.
>
> Without this, just enabling tracing (including perf) on any CPU causes a
> big disruption to the system.
>
> Maybe there's a simpler way to do this, but this isn't a niche market. It's
> pretty much all of the financial industry and likely other use cases as well.
My understanding of the high level dilemma here is as follows:
1- the kernel needs to learn about quiescence of all CPUs (e.g. context
synchronizing instructions) when it does code patching.
2- currently IPIs are sent to each non-idle CPU to achieve this.
3- NO_HZ userspace is allergic to IPI delays.
How about the following idea:
Introduce a new vDSO which can be called periodically from NO_HZ userspace
to note kernel quiescence for that CPU. It would do so by incrementing a
counter in the rseq per-thread area from userspace. Observing this counter
increment would allow the kernel to detect that this CPU was running in
userspace at some point between the two loads of that field from the kernel.
Those loads from the kernel would happen from remote CPUs. The running thread
on the NO_HZ CPU would be guaranteed stable by the rq lock.
Let me know if this may work, or if I'm missing the point entirely.
Thanks!
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com