Re: [PATCH v2 2/2] sched/uclamp: Protect uclamp fast path code with static key

From: Peter Zijlstra
Date: Wed Jun 24 2020 - 08:28:50 EST


On Wed, Jun 24, 2020 at 09:34:02AM +0200, Patrick Bellasi wrote:
> > +static DEFINE_STATIC_KEY_TRUE(sched_uclamp_unused);
>
> I would personally prefer a non negated semantic.

That's what I said earlier as well.


> > + */
> > + if (static_branch_likely(&sched_uclamp_unused))
> > + return;
>
> Moreover, something like:
>
> if (static_key_false(&sched_uclamp_enabled))
> return;
>
> is not just good enough?

static_key_true/false() are the deprecated API.