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

Commit f9026cd0 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched: walt: fix cluster sorting



The power_cost() returns the same value for all CPUs when HMP
is not defined. Due to this clusters are sorted incorrectly.
When HMP is not defined, use max_possible_capacity as the
power cost.

Change-Id: Ifcee551f4bc3a9a9ca938fcb24d04d5a08cddb98
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 5915565f
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -2676,6 +2676,15 @@ extern void sched_boost_parse_dt(void);
extern void clear_ed_task(struct task_struct *p, struct rq *rq);
extern bool early_detection_notify(struct rq *rq, u64 wallclock);

#ifdef CONFIG_SCHED_HMP
extern unsigned int power_cost(int cpu, u64 demand);
#else
static inline unsigned int power_cost(int cpu, u64 demand)
{
	return cpu_max_possible_capacity(cpu);
}
#endif

#else	/* CONFIG_SCHED_WALT */

struct hmp_sched_stats;
@@ -2828,6 +2837,11 @@ static inline bool early_detection_notify(struct rq *rq, u64 wallclock)
	return 0;
}

static inline unsigned int power_cost(int cpu, u64 demand)
{
	return SCHED_CAPACITY_SCALE;
}

#endif	/* CONFIG_SCHED_WALT */

#ifdef CONFIG_SCHED_HMP
@@ -2842,7 +2856,6 @@ extern void
check_for_freq_change(struct rq *rq, bool check_pred, bool check_groups);
extern void fixup_nr_big_tasks(struct hmp_sched_stats *stats,
					struct task_struct *p, s64 delta);
extern unsigned int power_cost(int cpu, u64 demand);
extern unsigned int cpu_temp(int cpu);
extern void pre_big_task_count_change(const struct cpumask *cpus);
extern void post_big_task_count_change(const struct cpumask *cpus);
@@ -2899,11 +2912,6 @@ check_for_freq_change(struct rq *rq, bool check_pred, bool check_groups) { }
static inline void fixup_nr_big_tasks(struct hmp_sched_stats *stats,
				      struct task_struct *p, s64 delta) { }

static inline unsigned int power_cost(int cpu, u64 demand)
{
	return SCHED_CAPACITY_SCALE;
}

static inline unsigned int cpu_temp(int cpu)
{
	return 0;