Re: [PATCH] sched/fair: use signed long when compute energy delta in eas

From: Pierre Gondois
Date: Tue Apr 13 2021 - 06:59:31 EST


Hi,
>
> In fair.c:select_task_rq_fair(), if feec() returns a error (< 0), then
> prev_cpu is selected. I think it's better to still let feec() signal
> that something happened and let select_task_rq_fair() select prev_cpu by
> itself.
In fair.c:select_task_rq_fair(), when feec() returns a error (< 0),
the new_cpu = find_idlest_cpu() or select_idle_sibling().
In your patch, you should return prev_cpu instead of -1 if you want to
select the prev_cpu.
Having a negative delta doesn't imply that prev_cpu is still available.
E.g.: If prev_cpu cannot receive the task (and is skipped), and a negative delta appears when evaluating the other CPUs. In such case feec() cannot select prev_cpu. dst_cpu must be selected by another function.

> Are you planning to submit a V2 with the bail out mechanism ?
Maybe it would be better if you submitted the V2 ? I just check the
patch and raised some questions.

I m ok to send a V2. I will submit it once we agreed.

Regards