Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b216c066 authored by Joonwoo Park's avatar Joonwoo Park
Browse files

sched: inline function scale_load_to_cpu()



Inline relatively small and frequently used function scale_load_to_cpu().

CRs-fixed: 849655
Change-Id: Id5f60595c394959d78e6da4cc4c18c338fec285b
Signed-off-by: default avatarJoonwoo Park <joonwoop@codeaurora.org>
parent 77c87a3b
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -2709,21 +2709,6 @@ int sched_get_cpu_mostly_idle_nr_run(int cpu)
	return rq->mostly_idle_nr_run;
}

/*
 * 'load' is in reference to "best cpu" at its best frequency.
 * Scale that in reference to a given cpu, accounting for how bad it is
 * in reference to "best cpu".
 */
u64 scale_load_to_cpu(u64 task_load, int cpu)
{
	struct rq *rq = cpu_rq(cpu);

	task_load *= (u64)rq->load_scale_factor;
	task_load /= 1024;

	return task_load;
}

#ifdef CONFIG_CGROUP_SCHED

static inline int upmigrate_discouraged(struct task_struct *p)
+15 −1
Original line number Diff line number Diff line
@@ -910,7 +910,6 @@ extern unsigned int sched_upmigrate;
extern unsigned int sched_downmigrate;
extern unsigned int sched_init_task_load_pelt;
extern unsigned int sched_init_task_load_windows;
extern u64 scale_load_to_cpu(u64 load, int cpu);
extern unsigned int sched_heavy_task;
extern unsigned int up_down_migrate_scale_factor;
extern void reset_cpu_hmp_stats(int cpu, int reset_cra);
@@ -922,6 +921,21 @@ unsigned int cpu_temp(int cpu);
extern unsigned int nr_eligible_big_tasks(int cpu);
extern void update_up_down_migrate(void);

/*
 * 'load' is in reference to "best cpu" at its best frequency.
 * Scale that in reference to a given cpu, accounting for how bad it is
 * in reference to "best cpu".
 */
static inline u64 scale_load_to_cpu(u64 task_load, int cpu)
{
	struct rq *rq = cpu_rq(cpu);

	task_load *= (u64)rq->load_scale_factor;
	task_load /= 1024;

	return task_load;
}

static inline int capacity(struct rq *rq)
{
	return rq->capacity;