Re: [PATCH] cpufreq: schedutil: Don't use the limits_changed flag any more
From: Viresh Kumar
Date: Tue Feb 09 2021 - 06:17:25 EST
On 08-02-21, 11:07, Yue Hu wrote:
> From: Yue Hu <huyue2@xxxxxxxxxx>
>
> The limits_changed flag was introduced by commit 600f5badb78c
> ("cpufreq: schedutil: Don't skip freq update when limits change") due
> to race condition where need_freq_update is cleared in get_next_freq()
> which causes reducing the CPU frequency is ineffective while busy.
>
> But now, the race condition above is gone because get_next_freq()
> doesn't clear the flag any more after commit 23a881852f3e ("cpufreq:
> schedutil: Don't skip freq update if need_freq_update is set").
>
> Moreover, need_freq_update currently will be set to true only in
> sugov_should_update_freq() if CPUFREQ_NEED_UPDATE_LIMITS is not set
> for the driver. However, limits may have changed at any time. And
> subsequent frequence update is depending on need_freq_update. So, we
> may skip this update.
>
> Hence, let's remove it to avoid above issue and make code more simple.
>
> Signed-off-by: Yue Hu <huyue2@xxxxxxxxxx>
> ---
> kernel/sched/cpufreq_schedutil.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
Acked-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
--
viresh