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

Commit cb42bcbe authored by Syed Rameez Mustafa's avatar Syed Rameez Mustafa Committed by Matt Wagantall
Browse files

sched: fix bail condition in bail_inter_cluster_balance()



Following commit efcad25cbfb (revert "sched: influence cpu_power based
on max_freq and efficiency), all CPUs in the system have the same
cpu_power and consequently the same group capacity. Therefore, the
check in bail_inter_cluster_balance() can now no longer be used to
distinguish a higher performance cluster from one with lower
performance. The check is currently broken and always returns true for
every load balancing attempt. Fix this by using runqueue capacity
instead which can still be used as a good measure of cluster
capabilities.

Change-Id: Idecfd1ed221d27d4324b20539e5224a92bf8b751
Signed-off-by: default avatarSteve Muckle <smuckle@codeaurora.org>
Signed-off-by: default avatarSyed Rameez Mustafa <rameezmustafa@codeaurora.org>
parent 184af1cd
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -6890,13 +6890,10 @@ bail_inter_cluster_balance(struct lb_env *env, struct sd_lb_stats *sds)
{
	int nr_cpus;

	if (sds->local_stat.group_capacity <=
			sds->busiest_stat.group_capacity)
	if (group_rq_capacity(sds->local) <= group_rq_capacity(sds->busiest))
		return 0;

	if (sds->busiest_stat.sum_nr_big_tasks &&
		 sds->local_stat.group_capacity >
			 sds->busiest_stat.group_capacity)
	if (sds->busiest_stat.sum_nr_big_tasks)
		return 0;

	nr_cpus = cpumask_weight(sched_group_cpus(sds->busiest));
+6 −0
Original line number Diff line number Diff line
@@ -833,6 +833,12 @@ static inline unsigned int group_first_cpu(struct sched_group *group)

extern int group_balance_cpu(struct sched_group *sg);

/*
 * Returns the rq capacity of any rq in a group. This does not play
 * well with groups where rq capacity can change independently.
 */
#define group_rq_capacity(group) capacity(cpu_rq(group_first_cpu(group)))

#else

static inline void sched_ttwu_pending(void) { }