Re: [PATCH v2 1/2] sched/schedutil: rework performance estimation

From: Vincent Guittot
Date: Thu Nov 02 2023 - 08:59:08 EST


On Thu, 2 Nov 2023 at 13:03, Dietmar Eggemann <dietmar.eggemann@xxxxxxx> wrote:
>
> On 26/10/2023 19:09, Vincent Guittot wrote:
>
> [...]
>
> > @@ -153,14 +152,38 @@ static unsigned int get_next_freq(struct sugov_policy *sg_policy,
> > return cpufreq_driver_resolve_freq(policy, freq);
> > }
> >
> > +unsigned long sugov_effective_cpu_perf(int cpu, unsigned long actual,
> > + unsigned long min,
> > + unsigned long max)
> > +{
> > + unsigned long target;
> > + struct rq *rq = cpu_rq(cpu);
> > +
> > + if (rt_rq_is_runnable(&rq->rt))
> > + return max;
> > +
> > + /* Provide at least enough capacity for DL + IRQ */
> > + target = min;
> > +
> > + actual = map_util_perf(actual);
> > + /* Actually we don't need to target the max performance */
> > + if (actual < max)
> > + max = actual;
> > +
> > + /*
> > + * Ensure at least minimum performance while providing more compute
> > + * capacity when possible.
> > + */
> > + return max(target, max);
>
> The superfluous `unsigned long target` is still there?

Yeah, I forgot to add the change in this version but it's in the next one

>
> return max(min, max) is much cleaer.
>
> [...]