Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad271f2d authored by Quentin Perret's avatar Quentin Perret
Browse files

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: default avatarQuentin Perret <quentin.perret@arm.com>
Change-Id: Ic9f01c8703d4f843addaa0d684012a422fe9f3b8
parent 9c83d843
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;

	/*
+5 −0
Original line number Diff line number Diff line
@@ -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)