aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorten Rasmussen <morten.rasmussen@arm.com>2013-08-06 16:14:19 +0100
committerJon Medhurst <tixy@linaro.org>2013-09-05 18:09:16 +0100
commitc05cd3079d0dd31ee5391a2a5c036fdecc67a136 (patch)
treef8ea63bee82dd07a2bae7b6f64af51c26a35bdac
parent83a3cdb6d37f700761be84a333d574709c5a0d2a (diff)
sched: HMP fix traversing the rb-tree from the curr pointer
The hmp_get_{lightest,heaviest}_task() need to use __pick_first_entity() to get a pointer to a sched_entity on the rq. The current is not kept on the rq while running, so its rb-tree node pointers are no longer valid. Signed-off-by: Chris Redpath <chris.redpath@arm.com> Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r--kernel/sched/fair.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 81579411348..b801eb0330e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3602,6 +3602,8 @@ static struct sched_entity *hmp_get_heaviest_task(
hmp = hmp_faster_domain(cpu_of(se->cfs_rq->rq));
hmp_target_mask = &hmp->cpus;
}
+ /* The currently running task is not on the runqueue */
+ se = __pick_first_entity(cfs_rq_of(se));
while (num_tasks && se) {
if (entity_is_task(se) &&
@@ -3630,10 +3632,11 @@ static struct sched_entity *hmp_get_lightest_task(
struct hmp_domain *hmp;
if (hmp_cpu_is_slowest(cpu_of(se->cfs_rq->rq)))
return min_se;
-
hmp = hmp_slower_domain(cpu_of(se->cfs_rq->rq));
hmp_target_mask = &hmp->cpus;
}
+ /* The currently running task is not on the runqueue */
+ se = __pick_first_entity(cfs_rq_of(se));
while (num_tasks && se) {
if (entity_is_task(se) &&