ANDROID: cpufreq/schedutil: Select frequency using util_avg for RT

Schedutil always requests max frequency whenever a RT task is running.
Now that we have a better estimate of the utilization of RT runqueues,
it is possible to make a less conservative decision and scale frequency
according to the needs of the RT tasks.

To do so, protect the RT-go-to-max code with a new sched_feature.
The sched_feature is disabled by default, hence favoring energy savings
as required in mobile environments.

Signed-off-by: Quentin Perret <quentin.perret@arm.com>
Change-Id: Ic9f01c8703d4f843addaa0d684012a422fe9f3b8
This commit is contained in:
Quentin Perret
2018-07-10 15:44:09 +01:00
parent 9c83d8435a
commit ad271f2d0d
2 changed files with 7 additions and 1 deletions

View File

@@ -204,7 +204,8 @@ unsigned long schedutil_freq_util(int cpu, unsigned long util_cfs,
struct rq *rq = cpu_rq(cpu);
unsigned long util, irq;
if (type == FREQUENCY_UTIL && rt_rq_is_runnable(&rq->rt))
if (sched_feat(SUGOV_RT_MAX_FREQ) && type == FREQUENCY_UTIL &&
rt_rq_is_runnable(&rq->rt))
return max;
/*

View File

@@ -104,3 +104,8 @@ SCHED_FEAT(FIND_BEST_TARGET, true)
* those tasks through the mainline slow path.
*/
SCHED_FEAT(EAS_PREFER_IDLE, true)
/*
* Request max frequency from schedutil whenever a RT task is running.
*/
SCHED_FEAT(SUGOV_RT_MAX_FREQ, false)