The SchedTune CPU boosting API is currently used from sugov_get_util() to get the boosted utilization and to pass it into schedutil_cpu_util(). When UtilClamp is in use instead we call schedutil_cpu_util() by passing in just the CFS utilization and the clamping is done internally on the aggregated CFS+RT utilization for FREQUENCY_UTIL calls. This asymmetry is not required moreover, schedutil code is polluted by non-mainline SchedTune code. Wrap SchedTune API call related to cpu utilization boosting with a more generic and mainlinish UtilClamp call: - uclamp_rq_util_with(cpu, util, p) <= boosted_cpu_util(cpu) This new API is already used in schedutil_cpu_util() to clamp the aggregated RT+CFS utilization on FREQUENCY_UTIL calls. Move the cpu boosting into uclamp_rq_util_with() so that we remove any SchedTune specific bit from kernel/sched/cpufreq_schedutil.c. Get rid of the no more required boosted_cpu_util(cpu) method and replace it with a stune_util(cpu, util) which signature is better aligned with its uclamp_rq_util_with(cpu, util, p) counterpart. Bug: 120440300 Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com> Signed-off-by: Qais Yousef <qais.yousef@arm.com> Change-Id: I45b0f0f54123fe0a2515fa9f1683842e6b99234f [Removed superfluous __maybe_unused for capacity_orig_of] Signed-off-by: Quentin Perret <qperret@google.com>
36 lines
833 B
C
36 lines
833 B
C
|
|
#ifdef CONFIG_SCHED_TUNE
|
|
|
|
#include <linux/reciprocal_div.h>
|
|
|
|
/*
|
|
* System energy normalization constants
|
|
*/
|
|
struct target_nrg {
|
|
unsigned long min_power;
|
|
unsigned long max_power;
|
|
struct reciprocal_value rdiv;
|
|
};
|
|
|
|
int schedtune_cpu_boost(int cpu);
|
|
int schedtune_task_boost(struct task_struct *tsk);
|
|
|
|
int schedtune_prefer_idle(struct task_struct *tsk);
|
|
|
|
void schedtune_enqueue_task(struct task_struct *p, int cpu);
|
|
void schedtune_dequeue_task(struct task_struct *p, int cpu);
|
|
|
|
unsigned long stune_util(int cpu, unsigned long other_util);
|
|
|
|
#else /* CONFIG_SCHED_TUNE */
|
|
|
|
#define schedtune_cpu_boost(cpu) 0
|
|
#define schedtune_task_boost(tsk) 0
|
|
|
|
#define schedtune_prefer_idle(tsk) 0
|
|
|
|
#define schedtune_enqueue_task(task, cpu) do { } while (0)
|
|
#define schedtune_dequeue_task(task, cpu) do { } while (0)
|
|
|
|
#endif /* CONFIG_SCHED_TUNE */
|