sched: Only down migrate low priority tasks if allowed by affinity mask
authorMorten Rasmussen <morten.rasmussen@arm.com>
Thu, 29 Jan 2015 09:05:30 +0000 (18:05 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:41:30 +0000 (13:41 +0900)
Adds an extra check intersection of the task affinity mask and the slower
hmp_domain cpumask before down migrating low priority tasks.

Signed-off-by: Morten Rasmussen <morten.rasmussen@arm.com>
[k.kozlowski: rebased on 4.1, no signed-off-by of previous committer]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
kernel/sched/fair.c

index ad50298..3fe12d0 100644 (file)
@@ -7986,8 +7986,11 @@ static unsigned int hmp_down_migration(int cpu, struct sched_entity *se)
 
 #ifdef CONFIG_SCHED_HMP_PRIO_FILTER
        /* Filter by task priority */
-       if (p->prio >= hmp_up_prio)
+       if ((p->prio >= hmp_up_prio) &&
+               cpumask_intersects(&hmp_slower_domain(cpu)->cpus,
+                                       tsk_cpus_allowed(p))) {
                return 1;
+       }
 #endif
 
        /* Let the task load settle before doing another down migration */