diff options
author | Dietmar Eggemann <dietmar.eggemann@arm.com> | 2015-07-21 17:32:00 +0100 |
---|---|---|
committer | Jon Medhurst <tixy@linaro.org> | 2015-09-15 12:24:45 +0100 |
commit | 6733f7207b94731023ed4b539108282162e5a526 (patch) | |
tree | 08c7e8ae0b774ecfb13d9773901dd5df5ecfc7be | |
parent | 99fe6674ab80869c74211744c234d30a92fda748 (diff) |
HMP: Use cpu_possible_mask instead of cpu_all_mask
Use cpu_possible_mask instead of cpu_all_mask in __setscheduler() to make
the detection of rt tasks whose cpus_allowed cpu mask hasn't been altered
yet more robust.
For those tasks p->cpus_allowed is equal to cpu_online_mask and not
necessarily to cpu_all_mask.
Tested on TC2: NR_CPUS = 8 -> cpu_all_mask = 0-7
#cpus = 5 -> cpu_possible_mask = 0-4
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r-- | kernel/sched/core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 17849da0115b..d5f12fb55422 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3357,7 +3357,8 @@ static void __setscheduler(struct rq *rq, struct task_struct *p, p->sched_class = &rt_sched_class; #ifdef CONFIG_SCHED_HMP if (!cpumask_empty(&hmp_slow_cpu_mask)) - if (cpumask_equal(&p->cpus_allowed, cpu_all_mask)) { + if (cpumask_equal(&p->cpus_allowed, + cpu_possible_mask)) { p->nr_cpus_allowed = cpumask_weight(&hmp_slow_cpu_mask); do_set_cpus_allowed(p, &hmp_slow_cpu_mask); |