sched: Update max cpu capacity in case of max frequency constraints
[firefly-linux-kernel-4.4.55.git] / kernel / sched / core.c
index 9d82f4c47e3b8f3d400df69f46b8f3a9a3945c1e..20df4c102fba0cefbbf7d0118a98bf700314497c 100644 (file)
@@ -5888,6 +5888,8 @@ static int init_rootdomain(struct root_domain *rd)
 
        if (cpupri_init(&rd->cpupri) != 0)
                goto free_rto_mask;
+
+       init_max_cpu_capacity(&rd->max_cpu_capacity);
        return 0;
 
 free_rto_mask:
@@ -5994,6 +5996,7 @@ DEFINE_PER_CPU(struct sched_domain *, sd_numa);
 DEFINE_PER_CPU(struct sched_domain *, sd_busy);
 DEFINE_PER_CPU(struct sched_domain *, sd_asym);
 DEFINE_PER_CPU(struct sched_domain *, sd_ea);
+DEFINE_PER_CPU(struct sched_domain *, sd_scs);
 
 static void update_top_cache_domain(int cpu)
 {
@@ -6027,6 +6030,9 @@ static void update_top_cache_domain(int cpu)
                        break;
        }
        rcu_assign_pointer(per_cpu(sd_ea, cpu), ea_sd);
+
+       sd = highest_flag_domain(cpu, SD_SHARE_CAP_STATES);
+       rcu_assign_pointer(per_cpu(sd_scs, cpu), sd);
 }
 
 /*
@@ -7101,15 +7107,9 @@ static int build_sched_domains(const struct cpumask *cpu_map,
                rq = cpu_rq(i);
                sd = *per_cpu_ptr(d.sd, i);
                cpu_attach_domain(sd, d.rd, i);
-
-               if (rq->cpu_capacity_orig > rq->rd->max_cpu_capacity)
-                       rq->rd->max_cpu_capacity = rq->cpu_capacity_orig;
        }
        rcu_read_unlock();
 
-       if (rq)
-               pr_info("max cpu_capacity %lu\n", rq->rd->max_cpu_capacity);
-
        ret = 0;
 error:
        __free_domain_allocs(&d, alloc_state, cpu_map);