lkml.org 
[lkml]   [2021]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched/fair: use signed long when compute energy delta in eas
Hi,

On Tuesday 30 Mar 2021 at 13:21:54 (+0800), Xuewen Yan wrote:
> From: Xuewen Yan <xuewen.yan@unisoc.com>
>
> now the energy delta compute as follow:
>
> base_energy_pd = compute_energy(p, -1, pd);
> --->Traverse all CPUs in pd
> --->em_pd_energy()
> ----------------------------------------------------- \
> search for the max_sapre_cap_cpu \
> --------------------------------- search time
> cur_delta = compute_energy(p, max_spare_cap_cpu, pd); /
> --->Traverse all CPUs in pd /
> ---------------------------------------------------- /
> --->em_pd_energy()
> cur_delta -= base_energy_pd;
>
> During the search_time, or when calculate the cpu_util in
> compute_energy(), there may occurred task dequeue or cpu_util change,
> it may cause the cur_energy < base_energy_pd, so the cur_delta
> would be negative. But the cur_delta is unsigned long, at this time,
> the cur_delta would always bigger than best_delta of last pd.
>
> Change the vars to signed long.

Is that really helping though?

Yes you will not overflow, but the decision is still 'wrong' if the util
values are not stable for the entire wake-up. I think folks on the Arm
side had patches to try and cache the util values upfront, and then use
them throughout feec() and compute_energy(), which I think would be a
better fix.

Dietmar, wdyt?

Thanks,
Quentin

\
 
 \ /
  Last update: 2021-03-30 11:47    [W:0.056 / U:4.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site