Re: [PATCH 0/4] Introduce QPW for per-cpu operations

From: Vlastimil Babka (SUSE)

Date: Mon Mar 09 2026 - 05:53:47 EST


On 3/8/26 18:41, Leonardo Bras wrote:
> Hi Marcelo,
>
> Great, hiding migrate_disable under the static branch is the best scenario.
>
> I wonder why we spend 2 cycles on the static branches, though, should be
> close to nothing unless the branch predictor is too busy already. Well, we

AFAIK static branches are runtime patched to non-conditional jumps or nops,
so there's nothing left for the branch predictor to do. Or maybe I
misunderstand your comment.
It does however increase code footprint and thus instruction cache usage, so
maybe that's an effect of that.

> can always try to optimize in a different way.
>
> Thanks for the effort on this!
> Leo