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

Commit 2762432d authored by Morten Rasmussen's avatar Morten Rasmussen Committed by Gerrit - the friendly Code Review server
Browse files

FROMLIST: sched/core: Disable SD_ASYM_CPUCAPACITY for root_domains without asymmetry



When hotplugging cpus out or creating exclusive cpusets systems which
were asymmetric at boot might become symmetric. In this case leaving the
flag set might lead to suboptimal scheduling decisions.

The arch-code proving the flag doesn't have visibility of the cpuset
configuration so it must either be told by passing a cpumask or by
letting the generic topology code verify if the flag should still be set
when taking the actual sched_domain_span() into account. This patch
implements the latter approach.

Signed-off-by: default avatarMorten Rasmussen <morten.rasmussen@arm.com>
[from https://lore.kernel.org/lkml/1530699470-29808-12-git-send-email-morten.rasmussen@arm.com/

]
Signed-off-by: default avatarValentin Schneider <valentin.schneider@arm.com>
Signed-off-by: default avatarChris Redpath <chris.redpath@arm.com>
Change-Id: I6a369e474743c96fe0b866ebb084e0a250e8c5d7
Git-commit: 052f19c5
Git-repo: https://android.googlesource.com/kernel/common/


Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent 4635e587
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -1310,6 +1310,26 @@ sd_init(struct sched_domain_topology_level *tl,
	cpumask_and(sched_domain_span(sd), cpu_map, tl->mask(cpu));
	sd_id = cpumask_first(sched_domain_span(sd));

	/*
	 * Check if cpu_map eclipses cpu capacity asymmetry.
	 */

	if (sd->flags & SD_ASYM_CPUCAPACITY) {
		long capacity = arch_scale_cpu_capacity(NULL, sd_id);
		bool disable = true;
		int i;

		for_each_cpu(i, sched_domain_span(sd)) {
			if (capacity != arch_scale_cpu_capacity(NULL, i)) {
				disable = false;
				break;
			}
		}

		if (disable)
			sd->flags &= ~SD_ASYM_CPUCAPACITY;
	}

	/*
	 * Convert topological properties into behaviour.
	 */
@@ -2103,4 +2123,3 @@ void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],

	mutex_unlock(&sched_domains_mutex);
}