Re: [PATCH v5 7/7] sched/fair: Add latency list

From: Vincent Guittot
Date: Wed Oct 26 2022 - 09:57:10 EST


On Wed, 26 Oct 2022 at 12:44, Dietmar Eggemann <dietmar.eggemann@xxxxxxx> wrote:
>
> On 12/10/2022 17:21, Vincent Guittot wrote:
> > Le mardi 11 oct. 2022 � 18:54:27 (-0500), Youssef Esmat a �crit :
> >> Hi Vincent,
> >>
> >> On Tue, Oct 11, 2022 at 12:10 PM Vincent Guittot
> >> <vincent.guittot@xxxxxxxxxx> wrote:
>
> [...]
>
> > @@ -10894,12 +10898,17 @@ static int cpu_idle_write_s64(struct cgroup_subsys_state *css,
> > static s64 cpu_latency_nice_read_s64(struct cgroup_subsys_state *css,
> > struct cftype *cft)
> > {
> > + unsigned long period = sysctl_sched_latency;
> > int last_delta = INT_MAX;
> > int prio, delta;
> > s64 weight;
> >
> > + if (sched_feat(GENTLE_FAIR_SLEEPERS))
> > + period >>= 1;
> > +
> > weight = css_tg(css)->latency_offset * NICE_LATENCY_WEIGHT_MAX;
> > - weight = div_s64(weight, sysctl_sched_latency);
> > + period = sysctl_sched_latency;
>
> Looks like this line is wrong here, period has been set already for
> GENTLE_FAIR_SLEEPERS and !GENTLE_FAIR_SLEEPERS?

Yes, I have factorized this in a function and the new version that I'm
preparing so The formula is not duplicated with the risk of error like
above

>
> > + weight = div_s64(weight, period);
> >
> > /* Find the closest nice value to the current weight */
> > for (prio = 0; prio < ARRAY_SIZE(sched_latency_to_weight); prio++) {
>
> [...]
>