Re: [PATCH 1/3] sched/rt: cpupri_find: implement fallback mechanism for !fit case

From: Steven Rostedt
Date: Tue Feb 18 2020 - 13:03:04 EST


On Tue, 18 Feb 2020 17:27:46 +0000
Qais Yousef <qais.yousef@xxxxxxx> wrote:

> > If we are going to use static branches, then lets just remove the
> > parameter totally. That is, make two functions (with helpers), where
> > one needs this fitness function the other does not.
> >
> > if (static_branch_unlikely(&sched_asym_cpu_capacity))
> > ret = cpupri_find_fitness(...);
> > else
> > ret = cpupri_find(...);
> >
> > if (!ret)
> > return -1;
> >
> > Something like that?
>
> Is there any implication on code generation here?
>
> I like my flavour better tbh. But I don't mind refactoring the function out if
> it does make it more readable.

I just figured we remove the passing of the parameter (which does make
an impact on the code generation).

Also, perhaps it would be better to not have to pass functions to the
cpupri_find(). Is there any other function that needs to be past, or
just this one in this series?

-- Steve