Re: Uclamp races due to non-atomic static_branch_likely updates

From: Steven Rostedt

Date: Wed Oct 21 2026 - 10:09:03 EST


On Wed, 21 Oct 2026 15:34:30 +0200
Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> That simply doesn't work.
>
> Even *IF* memory stores would propagate instantly (they don't) you can
> still have the boolean swap while in the middle of this state.
>
> ---
>
> B = true;
>
> CPU0 CPU1
>
> enqueue
> if (B)
> something++;
>
> B = false;
>
> dequeue
> if (B)
> something--;
>
>
> ---
>
> Will still be left with something unbalanced, even if everything is
> super duper magically atomic.

Fair point.

-- Steve