From: Morten Rasmussen Date: Mon, 19 Aug 2013 14:06:16 +0000 (+0100) Subject: sched: HMP fix traversing the rb-tree from the curr pointer X-Git-Tag: firefly_0821_release~3680^2~5^2~3^2~18^2~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=aaba2453951b3743d003be228102e1da63c75326;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Liviu Dudau Signed-off-by: Jon Medhurst --- diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 81579411348d..b801eb0330e1 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) &&