lkml.org 
[lkml]   [2018]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][RFC] sched: cpufreq: Fix long idle judgement logic in load calculation
On 07-06-18, 11:17, Chen Yu wrote:
> diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
> index 871bf9c..9792c80 100644
> --- a/drivers/cpufreq/cpufreq_governor.c
> +++ b/drivers/cpufreq/cpufreq_governor.c
> @@ -165,7 +165,7 @@ unsigned int dbs_update(struct cpufreq_policy *policy)
> * calls, so the previous load value can be used then.
> */
> load = j_cdbs->prev_load;
> - } else if (unlikely(time_elapsed > 2 * sampling_rate &&
> + } else if (((int)idle_time > 0) && unlikely(idle_time > 2 * sampling_rate &&

Yes the figures are insane, but if the idle time is around 36 minutes, the
conversion to int will make a positive value look negative and we will exit the
conditional block. And if we don't think that we will ever get such insane idle
times or we don't want to care about them, then what about doing this instead:

} else if ((unlikely((int)idle_time > 2 * sampling_rate &&

same below.

--
viresh

\
 
 \ /
  Last update: 2018-06-07 06:46    [W:0.078 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site