Re: [GIT pull] x86/urgent for v6.11-rc3
From: Thomas Gleixner
Date: Mon Aug 12 2024 - 04:21:14 EST
On Sun, Aug 11 2024 at 11:07, Linus Torvalds wrote:
> On Sun, 11 Aug 2024 at 06:58, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> Our static key code is pretty confusing, but we basically have
>
> - virt_spin_lock_key is now a "struct static_key_false", which means
> that we consider the virt case the unlikely case.
>
> I agree whole-heartedly, because it's going to be the slow case
> anyway, so this is good.
>
> - that means that 'static_branch_likely()' will generate a branch
> (because the key is marked unlikely0
>
> Isn't this wrong? So instead of falling through to the native
> qspinlock case, we will branch to it, and we fall through to the
> virt-spinlock case?
>
> So i think that static_branch_likely() should have been changed to a
> static_branch_unlikely() too, but it's possible that I've just
> confused myself.
You are right. It creates a branch for the !virt_lock case.
> Anyway, somebody should double-check me.
>
> I doubt it actually matters, since I think this all is fundamentally
> just in the slow-path, so the "do a branch or a no-op" is likely
> entirely in the noise even if I followed the code right. But it looked
> off to me.
It is off and yes it won't matter much in the slowpath maze.
Thanks
tglx