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

Commit 372ae503 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched: fix bail condition in bail_inter_cluster_balance()"

parents dfe9e45f 9c374948
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -5456,11 +5456,10 @@ bail_inter_cluster_balance(struct lb_env *env, struct sd_lb_stats *sds)
{
	int nr_cpus;

	if (sds->this_group_capacity <= sds->busiest_group_capacity)
	if (group_rq_capacity(sds->this) <= group_rq_capacity(sds->busiest))
		return 0;

	if (sds->busiest_nr_big_tasks &&
			 sds->this_group_capacity > sds->busiest_group_capacity)
	if (sds->busiest_nr_big_tasks)
		return 0;

	nr_cpus = cpumask_weight(sched_group_cpus(sds->busiest));
@@ -5796,15 +5795,10 @@ static bool update_sd_pick_busiest(struct lb_env *env,
				   struct sched_group *sg,
				   struct sg_lb_stats *sgs)
{
	unsigned long capacity;

	if (sgs->avg_load <= sds->max_load)
		return false;

	capacity = (env->idle == CPU_NOT_IDLE) ? sgs->group_capacity :
				cpumask_weight(sched_group_cpus(sg));

	if (sgs->sum_nr_running > capacity) {
	if (sgs->sum_nr_running > sgs->group_capacity) {
		env->flags &= ~LBF_PWR_ACTIVE_BALANCE;
		return true;
	}
+6 −0
Original line number Diff line number Diff line
@@ -673,6 +673,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)))

#endif /* CONFIG_SMP */

#include "stats.h"