ANDROID: sched: add vendor hook to PELT multiplier

We add vendor hook at sched_pelt_multiplier for
performance tuning.

Bug: 268491135

Change-Id: I10e3436a986dd5dd7d375460922407666f27739d
Signed-off-by: Jing-Ting Wu <Jing-Ting.Wu@mediatek.com>
This commit is contained in:
Jing-Ting Wu 2022-07-26 21:04:35 +08:00 committed by Todd Kjos
parent b37f61c269
commit cc50e0da70
3 changed files with 10 additions and 0 deletions

View File

@ -333,6 +333,10 @@ DECLARE_RESTRICTED_HOOK(android_rvh_find_energy_efficient_cpu,
TP_PROTO(struct task_struct *p, int prev_cpu, int sync, int *new_cpu),
TP_ARGS(p, prev_cpu, sync, new_cpu), 1);
DECLARE_HOOK(android_vh_sched_pelt_multiplier,
TP_PROTO(unsigned int old, unsigned int cur, int *ret),
TP_ARGS(old, cur, ret));
/* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_SCHED_H */

View File

@ -472,6 +472,7 @@ int update_irq_load_avg(struct rq *rq, u64 running)
__read_mostly unsigned int sched_pelt_lshift;
#ifdef CONFIG_SYSCTL
#include <trace/hooks/sched.h>
static unsigned int sysctl_sched_pelt_multiplier = 1;
int sched_pelt_multiplier(struct ctl_table *table, int write, void *buffer,
@ -489,6 +490,10 @@ int sched_pelt_multiplier(struct ctl_table *table, int write, void *buffer,
if (!write)
goto done;
trace_android_vh_sched_pelt_multiplier(old, sysctl_sched_pelt_multiplier, &ret);
if (ret)
goto undo;
switch (sysctl_sched_pelt_multiplier) {
case 1:
fallthrough;

View File

@ -86,3 +86,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_wake_up_sync);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_wake_flags);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_new_ilb);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_energy_efficient_cpu);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_pelt_multiplier);