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

Commit 0d138f0f authored by Chris Redpath's avatar Chris Redpath Committed by Runmin Wang
Browse files

ANDROID: sched/fair: Attempt to improve throughput for asym cap systems



In some systems the capacity and group weights line up to defeat all the
small imbalance correction conditions in fix_small_imbalance, which can
cause bad task placement. Add a new condition if the existing code can't
see anything to fix:

If we have asymmetric capacity, and there are more tasks than CPUs in
the busiest group *and* there are less tasks than CPUs in the local group
then we try to pull something. There could be transient small tasks which
prevent this from working, but on the whole it is beneficial for those
systems with inconvenient capacity/cluster size relationships.

Change-Id: Icf81cde215c082a61f816534b7990ccb70aee409
Signed-off-by: default avatarChris Redpath <chris.redpath@arm.com>
Git-commit: 92f1c4fa958a0f01dd35408c08b489f046e8b68c
Git-repo: https://android.googlesource.com/kernel/common/


Signed-off-by: default avatarRunmin Wang <runminw@codeaurora.org>
parent f5438882
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -9914,7 +9914,22 @@ void fix_small_imbalance(struct lb_env *env, struct sd_lb_stats *sds)
	capa_move /= SCHED_CAPACITY_SCALE;

	/* Move if we gain throughput */
	if (capa_move > capa_now)
	if (capa_move > capa_now) {
		env->imbalance = busiest->load_per_task;
		return;
	}

	/* We can't see throughput improvement with the load-based
	 * method, but it is possible depending upon group size and
	 * capacity range that there might still be an underutilized
	 * cpu available in an asymmetric capacity system. Do one last
	 * check just in case.
	 */
	if (env->sd->flags & SD_ASYM_CPUCAPACITY &&
		busiest->group_type == group_overloaded &&
		busiest->sum_nr_running > busiest->group_weight &&
		local->sum_nr_running < local->group_weight &&
		local->group_capacity < busiest->group_capacity)
		env->imbalance = busiest->load_per_task;
}