ANDROID: Add new hook to enable overriding uclamp_validate()

We want to add more special values, specifically for uclamp_max so that
it can be set automatically to the most efficient value based on the
core it's running on.

Bug: 297343949
Signed-off-by: Qais Yousef <qyousef@google.com>
Change-Id: I57343c4544f6cac621c855cbb94de0b8d80c51fa
This commit is contained in:
Qais Yousef 2023-05-11 15:34:13 +00:00 committed by Treehugger Robot
parent b57e3c1d99
commit 5762974151
3 changed files with 12 additions and 0 deletions

View File

@ -321,6 +321,11 @@ DECLARE_HOOK(android_vh_setscheduler_uclamp,
TP_PROTO(struct task_struct *tsk, int clamp_id, unsigned int value),
TP_ARGS(tsk, clamp_id, value));
DECLARE_HOOK(android_vh_uclamp_validate,
TP_PROTO(struct task_struct *p, const struct sched_attr *attr,
bool user, int *ret, bool *done),
TP_ARGS(p, attr, user, ret, done));
DECLARE_HOOK(android_vh_update_topology_flags_workfn,
TP_PROTO(void *unused),
TP_ARGS(unused));

View File

@ -1884,6 +1884,12 @@ static int uclamp_validate(struct task_struct *p,
{
int util_min = p->uclamp_req[UCLAMP_MIN].value;
int util_max = p->uclamp_req[UCLAMP_MAX].value;
bool done = false;
int ret = 0;
trace_android_vh_uclamp_validate(p, attr, user, &ret, &done);
if (done)
return ret;
if (attr->sched_flags & SCHED_FLAG_UTIL_CLAMP_MIN) {
util_min = attr->sched_util_min;

View File

@ -99,3 +99,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_irqtime_account_process_tick);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_post_init_entity_util_avg);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_effective_cpu_util);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmput);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_uclamp_validate);