RE: [PATCH] x86/resctrl: avoid compiler optimization in __resctrl_sched_in

From: Luck, Tony
Date: Tue Mar 07 2023 - 16:23:18 EST


> Linux has a lot of "static inline" functions. But that's not at all
> what that function was. It was literally just
>
> static void __resctrl_sched_in(..)
>
> which is disgusting and very wrong.

Ah. I was looking at:

static inline void resctrl_sched_in(void)
{
if (static_branch_likely(&rdt_enable_key))
__resctrl_sched_in();
}

which does have the "inline" attribute.

I wonder if checkpatch could catch missing "inline" on static
function definitions in header files?

-Tony