Merge "ANDROID: Re-use SUGOV_RT_MAX_FREQ to control uclamp rt behavior"

This commit is contained in:
qctecmdr 2020-02-01 21:26:28 -08:00 • committed by Gerrit - the friendly Code Review server
commit e64e00a6da
3 changed files with 16 additions and 3 deletions

View file

@ -1216,8 +1216,12 @@ static void __setscheduler_uclamp(struct task_struct *p,
continue;
/* By default, RT tasks always get 100% boost */
if (unlikely(rt_task(p) && clamp_id == UCLAMP_MIN))
if (sched_feat(SUGOV_RT_MAX_FREQ) &&
unlikely(rt_task(p) &&
clamp_id == UCLAMP_MIN)) {
clamp_value = uclamp_none(UCLAMP_MAX);
}
uclamp_se_set(uc_se, clamp_value, false);
}
@ -1250,8 +1254,12 @@ static void uclamp_fork(struct task_struct *p)
unsigned int clamp_value = uclamp_none(clamp_id);
/* By default, RT tasks always get 100% boost */
if (unlikely(rt_task(p) && clamp_id == UCLAMP_MIN))
if (sched_feat(SUGOV_RT_MAX_FREQ) &&
unlikely(rt_task(p) &&
clamp_id == UCLAMP_MIN)) {
clamp_value = uclamp_none(UCLAMP_MAX);
}
uclamp_se_set(&p->uclamp_req[clamp_id], clamp_value, false);
}

View file

@ -307,7 +307,7 @@ unsigned long schedutil_cpu_util(int cpu, unsigned long util_cfs,
unsigned long dl_util, util, irq;
struct rq *rq = cpu_rq(cpu);
if (!IS_BUILTIN(CONFIG_UCLAMP_TASK) &&
if (!IS_BUILTIN(CONFIG_UCLAMP_TASK) && sched_feat(SUGOV_RT_MAX_FREQ) &&
type == FREQUENCY_UTIL && rt_rq_is_runnable(&rq->rt)) {
return max;
}

View file

@ -94,3 +94,8 @@ SCHED_FEAT(UTIL_EST, true)
* Fast pre-selection of CPU candidates for EAS.
*/
SCHED_FEAT(FIND_BEST_TARGET, true)
/*
* Request max frequency from schedutil whenever a RT task is running.
*/
SCHED_FEAT(SUGOV_RT_MAX_FREQ, false)