mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
sched/core_ctl: Pass sorted clusters based on capacity to cluster_init
Core control assumes that the clusters in the system are sorted based on their capacity, i.e., first cluster is the minimum capacity cluster and last cluster is the max capacity cluster, but, there are systems which has max capacity cluster as first cluster of the system and min capacity cluster as last cluster in the system. This assumption breaks core control for systems with max capacity system as first cluster. To make sure core control won't be broken for such systems, pass sorted clusters based on the capacity to cluster_init. Change-Id: Ib27698080b9e4fe8b0e7789b9042d0a210fda486 Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
This commit is contained in:
parent
57116e1446
commit
833279caa2
@ -1233,8 +1233,8 @@ static int cluster_init(const struct cpumask *mask)
|
||||
|
||||
static int __init core_ctl_init(void)
|
||||
{
|
||||
unsigned int cpu;
|
||||
struct cpumask cpus = *cpu_possible_mask;
|
||||
struct sched_cluster *cluster;
|
||||
int ret;
|
||||
|
||||
cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN,
|
||||
"core_ctl/isolation:online",
|
||||
@ -1244,15 +1244,12 @@ static int __init core_ctl_init(void)
|
||||
"core_ctl/isolation:dead",
|
||||
NULL, core_ctl_isolation_dead_cpu);
|
||||
|
||||
for_each_cpu(cpu, &cpus) {
|
||||
int ret;
|
||||
const struct cpumask *cluster_cpus = cpu_coregroup_mask(cpu);
|
||||
|
||||
ret = cluster_init(cluster_cpus);
|
||||
for_each_sched_cluster(cluster) {
|
||||
ret = cluster_init(&cluster->cpus);
|
||||
if (ret)
|
||||
pr_warn("unable to create core ctl group: %d\n", ret);
|
||||
cpumask_andnot(&cpus, &cpus, cluster_cpus);
|
||||
}
|
||||
|
||||
initialized = true;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user