kernel: ems/ego: Reduce frequencies slower

The schedutil governor reduces frequencies too fast in some
situations which cases undesirable performance drops to
appear.

To address that issue, make schedutil reduce the frequency slower by
setting it to the average of the value chosen during the previous
iteration of governor computations and the new one coming from its
frequency selection formula.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=194963
Reported-by: John <john.ettedgui@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Cykeek <Cykeek@proton.me>
Signed-off-by: negrroo <mohammedaelnaggar1@gmail.com>
Signed-off-by: priiii1808 <priyanshusinghal0818@gmail.com>
[Flopster101: Adapted to Exynos energy_aware governor]
Signed-off-by: Nahuel Gómez <nahuelgomez329@gmail.com>
This commit is contained in:
Rafael J. Wysocki 2022-12-31 14:08:56 +05:30 committed by Ksawlii
parent cdf47a7386
commit 51d3ee0bf3

View file

@ -519,6 +519,10 @@ static void ego_update_next_freq(struct ego_policy *egp, u64 time,
unsigned int next_freq)
{
ego_update_freq_variant_param(egp, time, next_freq);
if (egp->next_freq > next_freq)
next_freq = (egp->next_freq + next_freq) >> 1;
egp->next_freq = next_freq;
egp->last_freq_update_time = time;
}