]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - kernel/sched/core.c
sched: Extend scheduler's asym packing
[mirror_ubuntu-zesty-kernel.git] / kernel / sched / core.c
index dc64bd71ed2bc6a1d8d8c848015774c9d48ee3cc..393759bd526e84ace42a83eafe9bcda61d7aceec 100644 (file)
@@ -6303,7 +6303,22 @@ static void init_sched_groups_capacity(int cpu, struct sched_domain *sd)
        WARN_ON(!sg);
 
        do {
+               int cpu, max_cpu = -1;
+
                sg->group_weight = cpumask_weight(sched_group_cpus(sg));
+
+               if (!(sd->flags & SD_ASYM_PACKING))
+                       goto next;
+
+               for_each_cpu(cpu, sched_group_cpus(sg)) {
+                       if (max_cpu < 0)
+                               max_cpu = cpu;
+                       else if (sched_asym_prefer(cpu, max_cpu))
+                               max_cpu = cpu;
+               }
+               sg->asym_prefer_cpu = max_cpu;
+
+next:
                sg = sg->next;
        } while (sg != sd->groups);