sched/walt: Ensure frequency bump to fmax under walt rotation

Previously, frequencies would jump to fmax when walt rotation was
enabled. This was done through the early detection path. But, as a
consequence of early detection boost optimizations, frequencies
regressed under walt rotation.

Change-Id: I40f91ba873a9cc179fcfb23291dc4839e857428a
Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
This commit is contained in:
Shaleen Agrawal 2022-08-26 10:37:31 -07:00 committed by Sai Harshini Nimmala
parent b30e1d54a5
commit e3e14e56fb
3 changed files with 11 additions and 4 deletions

View File

@ -296,10 +296,11 @@ static void waltgov_walt_adjust(struct waltgov_cpu *wg_cpu, unsigned long cpu_ut
bool is_migration = wg_cpu->flags & WALT_CPUFREQ_IC_MIGRATION;
bool is_rtg_boost = wg_cpu->walt_load.rtgb_active;
bool is_hiload;
bool is_ed_boost = wg_cpu->walt_load.ed_active;
bool big_task_rotation = wg_cpu->walt_load.big_task_rotation;
bool employ_ed_boost = wg_cpu->walt_load.ed_active && sysctl_ed_boost_pct;
unsigned long pl = wg_cpu->walt_load.pl;
if (is_ed_boost) {
if (employ_ed_boost) {
cpu_util = mult_frac(cpu_util, 100 + sysctl_ed_boost_pct, 100);
max_and_reason(util, cpu_util, wg_cpu, CPUFREQ_REASON_EARLY_DET);
}
@ -323,8 +324,11 @@ static void waltgov_walt_adjust(struct waltgov_cpu *wg_cpu, unsigned long cpu_ut
max_and_reason(util, pl, wg_cpu, CPUFREQ_REASON_PL);
}
if (is_ed_boost)
if (employ_ed_boost)
wg_cpu->reasons |= CPUFREQ_REASON_EARLY_DET;
if (big_task_rotation)
max_and_reason(util, *max, wg_cpu, CPUFREQ_REASON_BTR);
}
static inline unsigned long target_util(struct waltgov_policy *wg_policy,

View File

@ -464,7 +464,7 @@ static void update_task_cpu_cycles(struct task_struct *p, int cpu,
static inline bool is_ed_enabled(void)
{
return (walt_rotation_enabled || (boost_policy != SCHED_BOOST_NONE));
return (boost_policy != SCHED_BOOST_NONE);
}
static inline bool is_ed_task(struct task_struct *p, u64 wallclock)
@ -652,6 +652,7 @@ __cpu_util_freq_walt(int cpu, struct walt_cpu_load *walt_load, unsigned int *rea
walt_load->pl = pl;
walt_load->ws = walt_load_reported_window;
walt_load->rtgb_active = rtgb_active;
walt_load->big_task_rotation = walt_rotation_enabled;
if (wrq->ed_task)
walt_load->ed_active = true;
else

View File

@ -60,6 +60,7 @@ struct walt_cpu_load {
bool rtgb_active;
u64 ws;
bool ed_active;
bool big_task_rotation;
};
#define DECLARE_BITMAP_ARRAY(name, nr, bits) \
@ -307,6 +308,7 @@ extern unsigned int sched_lib_mask_force;
#define WALT_CPUFREQ_BOOST_UPDATE 0x20
#define CPUFREQ_REASON_LOAD 0
#define CPUFREQ_REASON_BTR 0x1
#define CPUFREQ_REASON_PL 0x2
#define CPUFREQ_REASON_EARLY_DET 0x4
#define CPUFREQ_REASON_RTG_BOOST 0x8