Re: [PATCH v10 00/10] x86: Quiesce text_poke() IPIs
From: Andy Lutomirski
Date: Wed Dec 02 2026 - 12:08:30 EST
On Wed, Dec 2, 2026, at 2:43 AM, Valentin Schneider wrote:
> On 01/12/26 13:31, Andy Lutomirski wrote:
>> On Tue, Dec 1, 2026, at 3:13 AM, Valentin Schneider wrote:
>>
>>>
>>> Although now I would just not store anything and have a single,
>>> always-run-at-entry catchup sequence (like the CR3 RMW).
>>
>> CR3 is slow. Even SERIALIZE is probably pretty slow.
>>
>
> If we can get this enabled iff NOHZ_FULL is enabled & in use, then making
> kernel entry a few times more expensive is fair game IMO.
If implemented cleanly, my suggestion will boil down to:
u64 work = read_clear_quiescent_bits_unquiesce_rcu();
bool serialized = false;
if (work & TLBFLUSH) {
serialized = do_deferred_flushes();
}
if ((work & SERIALIZE) && !serialized) {
serialize();
}
read_clear_quiescent_bits_unquiesce_rcu() is mildly complex, but I claim that it can likely be implemented at the approximate cost of *one* MFENCE and/or CAS. The entry into quiescent mode should be a single store-release.
I think this entire sequence will be cheap enough that we should seriously consider enabling it unconditionally. Or *maybe* do it heuristically where we only quiesce in the first place if we think it makes sense, but I think it should at least be compiled into the kernel unconditionally.
If, on the other hand, we don't unify it with RCU, then we're starting to multiply the cost by a factor of at least two, and maybe we want it to stay conditional. Yuck.
FWIW, this code can (I think) be fully shared with the RCU idle EQS code, so long as we can make the same promises about vmap in the idle path as we would in the userspace path. That should be possible too unless we have truly stupid driver code, and that's where objtool would come in, I think.
--Andy