diff options
author | Dietmar Eggemann <dietmar.eggemann@arm.com> | 2015-02-03 15:38:08 +0900 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2016-12-14 13:41:40 +0900 |
commit | 13b080b7048061f266ddfad3ef5417584a2096f1 (patch) | |
tree | 1027bc36f950764573439556c70e3927724e7554 /kernel/sched | |
parent | 4d731660d10d5e20807fe9389f93453beb38c568 (diff) |
HMP: experimental: Force all rt tasks to start on little domain.
This patch restricts the allowed cpu mask for rt tasks initially started
with a full cpu mask to the little domain.
An rt task is specified as real time in __setscheduler() which is finally
called for all rt tasks (kernel and user land). In this function we
restrict the allowed cpu mask to the little domain.
This also prevents that a rt tasks can later be pushed to the big domain
because the function find_lowest_rq() will only recognize the allowed cpu
mask of a task to find the new cpu the task runs on.
Current kludges of the patch:
* Since we do not have an API to get the cpu mask of the A7 cluster,
hmp_slow_cpu_mask is made global in arm/kernel/topology.c for now.
* The watchdog_enable() function calls sched_setscheduler() before
kthread_bind() for the cpu specific watchdog kernel threads. The order of
these two calls has to be changed to make this patch work.
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
[k.kozlowski: rebased on 4.1, no signed-off-by of previous committer]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/core.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 83556c50e2f7..c4e222e267a5 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3341,6 +3341,8 @@ static void __setscheduler_params(struct task_struct *p, set_load_weight(p); } +extern struct cpumask hmp_slow_cpu_mask; + /* Actually do priority change: must hold pi & rq lock. */ static void __setscheduler(struct rq *rq, struct task_struct *p, const struct sched_attr *attr, bool keep_boost) @@ -3358,9 +3360,13 @@ static void __setscheduler(struct rq *rq, struct task_struct *p, if (dl_prio(p->prio)) p->sched_class = &dl_sched_class; - else if (rt_prio(p->prio)) + else if (rt_prio(p->prio)) { p->sched_class = &rt_sched_class; - else +#ifdef CONFIG_SCHED_HMP + if (cpumask_equal(&p->cpus_allowed, cpu_all_mask)) + do_set_cpus_allowed(p, &hmp_slow_cpu_mask); +#endif + } else p->sched_class = &fair_sched_class; } |