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

Commit 5ee367fc authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched/fair: Fix redundant load balancer reattempt due to LBF_ALL_PINNED



LBF_ALL_PINNED flag should cleared in can_migrate_task() if the task
can run on the destination CPU during load balance. In current code,
can_migrate_task() return incorrectly without clearing this flag
in case if the task can't be migrated to the destination CPU due to
cumulative window demand constraints. Since LBF_ALL_PINNED flag
is not cleared, load balancer thinks that none of the tasks running
on the busiest group can't be migrated to the destination CPU due
to affinity settings and tries to find another busiest group. Prevent
this incorrect reattempt of load balance by clearing LBF_ALL_PINNED
flag right after the task affinity check in can_migrate_task().

Change-Id: Iad1cf42b1aaf70106ee5ecfbd9499ccb6eb7497e
[clingutla@codeaurora.org: Resolved merge conflicts]
Signed-off-by: default avatarLingutla Chandrasekhar <clingutla@codeaurora.org>
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 22c06a04
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -8372,6 +8372,9 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
		return 0;
	}

	/* Record that we found atleast one task that could run on dst_cpu */
	env->flags &= ~LBF_ALL_PINNED;

	if (energy_aware() && !env->dst_rq->rd->overutilized &&
	    env->idle == CPU_NEWLY_IDLE) {
		long util_cum_dst, util_cum_src;
@@ -8385,9 +8388,6 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
			return 0;
	}

	/* Record that we found atleast one task that could run on dst_cpu */
	env->flags &= ~LBF_ALL_PINNED;

#ifdef CONFIG_SCHED_WALT
	if (env->flags & LBF_IGNORE_PREFERRED_CLUSTER_TASKS &&
			 !preferred_cluster(cpu_rq(env->dst_cpu)->cluster, p))