Commonly used APIs are delcared redundantly in several files in EMS.
It is integrated into core.c.
Change-Id: Ic42d508d1083f9321c856452f50731c2a9fa9adf
Signed-off-by: Park Bumgyu <bumgyu.park@samsung.com>
extern unsigned long global_boost(void);
extern int find_second_max_cap(void);
+extern int
+exynos_wakeup_balance(struct task_struct *p, int prev_cpu, int sd_flag, int sync);
extern int exynos_select_cpu(struct task_struct *p, int *backup_cpu,
bool boosted, bool prefer_idle);
static inline unsigned long global_boost(void) { return 0; }
static inline int find_second_max_cap(void) { return -EINVAL; }
+static inline int
+exynos_wakeup_balance(struct task_struct *p, int prev_cpu, int sd_flag, int sync)
+{
+ return -1;
+}
static inline int exynos_select_cpu(struct task_struct *p, int *backup_cpu,
bool boosted, bool prefer_idle) { return -EINVAL; }
#include "ems.h"
#include "../sched.h"
+int task_util(struct task_struct *p)
+{
+ return p->se.avg.util_avg;
+}
+
+int cpu_util_wake(int cpu, struct task_struct *p)
+{
+ unsigned long util, capacity;
+
+ /* Task has no contribution or is new */
+ if (cpu != task_cpu(p) || !p->se.avg.last_update_time)
+ return cpu_util(cpu);
+
+ capacity = capacity_orig_of(cpu);
+ util = max_t(long, cpu_rq(cpu)->cfs.avg.util_avg - task_util(p), 0);
+
+ return (util >= capacity) ? capacity : util;
+}
+
static int select_proper_cpu(struct task_struct *p)
{
return -1;
static inline int group_balancing(struct task_struct *p) { return -1; }
#endif
-#ifdef CONFIG_SCHED_EMS
-extern int
-exynos_wakeup_balance(struct task_struct *p, int prev_cpu, int sd_flag, int sync);
-#else
-static inline int
-exynos_wakeup_balance(struct task_struct *p, int prev_cpu, int sd_flag, int sync)
-{
- return -1;
-}
-#endif
+extern int task_util(struct task_struct *p);
+extern int cpu_util_wake(int cpu, struct task_struct *p);
#include "ems.h"
#include "../sched.h"
-static int task_util(struct task_struct *p)
-{
- return p->se.avg.util_avg;
-}
-
-static int cpu_util_wake(int cpu, struct task_struct *p)
-{
- unsigned long util, capacity;
-
- /* Task has no contribution or is new */
- if (cpu != task_cpu(p) || !p->se.avg.last_update_time)
- return cpu_util(cpu);
-
- capacity = capacity_orig_of(cpu);
- util = max_t(long, cpu_rq(cpu)->cfs.avg.util_avg - task_util(p), 0);
-
- return (util >= capacity) ? capacity : util;
-}
-
/*
* The compute capacity, power consumption at this compute capacity and
* frequency of state. The cap and power are used to find the energy
return -1;
}
-static inline unsigned long task_util(struct task_struct *p)
-{
- return p->se.avg.util_avg;
-}
-
-static inline int check_migration_task(struct task_struct *p)
-{
- return !p->se.avg.last_update_time;
-}
-
-static inline unsigned long cpu_util_wake(int cpu, struct task_struct *p)
-{
- unsigned long util, capacity;
-
- /* Task has no contribution or is new */
- if (cpu != task_cpu(p) || check_migration_task(p))
- return cpu_util(cpu);
-
- capacity = capacity_orig_of(cpu);
- util = max_t(long, cpu_util(cpu) - task_util(p), 0);
-
- return (util >= capacity) ? capacity : util;
-}
-
/****************************************************************/
/* External APIs */
/****************************************************************/
#include "../sched.h"
#include "../tune.h"
-static inline unsigned long task_util(struct task_struct *p)
-{
- return p->se.avg.util_avg;
-}
-
-static inline int check_migration_task(struct task_struct *p)
-{
- return !p->se.avg.last_update_time;
-}
-
-static inline unsigned long cpu_util_wake(int cpu, struct task_struct *p)
-{
- unsigned long util, capacity;
-
- /* Task has no contribution or is new */
- if (cpu != task_cpu(p) || check_migration_task(p))
- return cpu_util(cpu);
-
- capacity = capacity_orig_of(cpu);
- util = max_t(long, cpu_util(cpu) - task_util(p), 0);
-
- return (util >= capacity) ? capacity : util;
-}
-
/**********************************************************************
* Prefer Perf *
**********************************************************************/
#include "sched.h"
#include "tune.h"
#include "walt.h"
-#include "ems/ems.h"
/*
* Targeted preemption latency for CPU-bound tasks: