HMP: Check the system has little cpus before forcing rt tasks onto them
authorJon Medhurst (Tixy) <tixy@linaro.org>
Fri, 2 Aug 2013 17:45:33 +0000 (18:45 +0100)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Mon, 12 May 2014 11:02:20 +0000 (12:02 +0100)
It is sometimes desirable to run a kernel with HMP scheduling enabled
on a system which is not big.LITTLE, e.g. when building a multi-platform
kernel, or when testing a big.LITTLE system with one cluster disabled.

We should therefore allow for the situation where is no little domain.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
kernel/sched/core.c

index 87b021e..84367d6 100644 (file)
@@ -3185,8 +3185,9 @@ static void __setscheduler(struct rq *rq, struct task_struct *p,
        else if (rt_prio(p->prio)) {
                p->sched_class = &rt_sched_class;
 #ifdef CONFIG_SCHED_HMP
-               if (cpumask_equal(&p->cpus_allowed, cpu_all_mask))
-                       do_set_cpus_allowed(p, &hmp_slow_cpu_mask);
+               if (!cpumask_empty(&hmp_slow_cpu_mask))
+                       if (cpumask_equal(&p->cpus_allowed, cpu_all_mask))
+                               do_set_cpus_allowed(p, &hmp_slow_cpu_mask);
 #endif
        }
        else