android_kernel_xiaomi_sm7250/kernel/sched/tune.h
Rick Yiu a1460afbc4 sched: refine code for computing energy
When computing energy of each cpu, we should simulate the boost
margin if the task is enqueued on that cpu. This is to sync with
ACK change - aosp/1346105.

Bug: 158637636
Test: build pass
Change-Id: If5cbec9ac04fea46830c32f797c6b09dce1ea1a2
Signed-off-by: Rick Yiu <rickyiu@google.com>
2022-11-12 11:25:06 +00:00

36 lines
904 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_with(int cpu, struct task_struct *p);
int schedtune_task_boost(struct task_struct *tsk);
int schedtune_prefer_idle(struct task_struct *tsk);
bool schedtune_prefer_high_cap(struct task_struct *tsk);
void schedtune_enqueue_task(struct task_struct *p, int cpu);
void schedtune_dequeue_task(struct task_struct *p, int cpu);
#else /* CONFIG_SCHED_TUNE */
#define schedtune_cpu_boost_with(cpu, p) 0
#define schedtune_task_boost(tsk) 0
#define schedtune_prefer_idle(tsk) 0
#define schedtune_prefer_high_cap(tsk) 0
#define schedtune_enqueue_task(task, cpu) do { } while (0)
#define schedtune_dequeue_task(task, cpu) do { } while (0)
#endif /* CONFIG_SCHED_TUNE */