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

From: Dietmar Eggemann
Date: Wed Oct 26 2022 - 06:44:36 EST


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?

> + 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++) {

[...]