Re: [PATCH 0/4] Introduce QPW for per-cpu operations
From: Leonardo Bras
Date: Tue Mar 10 2026 - 20:01:17 EST
On Mon, Mar 09, 2026 at 10:52:55AM +0100, Vlastimil Babka (SUSE) wrote:
> 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.
Oh, I was not aware of that part. Since we can actually change the the
branch decision variable in runtime, I guessed that it was just a optimized
way for the processor to use the branch predictor.
If it makes a non-conditional branch is even better then.
Thanks!
Leo
>
> > can always try to optimize in a different way.
> >
> > Thanks for the effort on this!
> > Leo