Skip to content

Commit

Permalink
sched/core: Fix DL runtime accounting during migration
Browse files Browse the repository at this point in the history
Warnings are being triggered when running dl tasks from rt-app.
This seems to be a bug in walleye's 4.4 kernel arising from HMP
the revert. Due to that this patch was missed:

commit 3ea94de
Author: Joonwoo Park <joonwoop@codeaurora.org>
Date:   Thu Nov 12 19:38:54 2015 -0800
    sched/core: Fix incorrect wait time and wait count statistics

Fix the issue by reordering the flag setting before calling class
enqueue/dequeue callbacks.

Change-Id: I1b7ab408c307698ef67b0f1b05dcce06cc9ce625
Signed-off-by: Joel Fernandes <joelaf@google.com>
  • Loading branch information
Joel Fernandes committed Mar 27, 2018
1 parent 8444558 commit ac40d51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/sched/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1154,8 +1154,8 @@ static struct rq *move_queued_task(struct rq *rq, struct task_struct *p, int new
{
lockdep_assert_held(&rq->lock);

dequeue_task(rq, p, 0);
p->on_rq = TASK_ON_RQ_MIGRATING;
dequeue_task(rq, p, 0);
double_lock_balance(rq, cpu_rq(new_cpu));
set_task_cpu(p, new_cpu);
double_unlock_balance(rq, cpu_rq(new_cpu));
Expand All @@ -1165,8 +1165,8 @@ static struct rq *move_queued_task(struct rq *rq, struct task_struct *p, int new

raw_spin_lock(&rq->lock);
BUG_ON(task_cpu(p) != new_cpu);
p->on_rq = TASK_ON_RQ_QUEUED;
enqueue_task(rq, p, 0);
p->on_rq = TASK_ON_RQ_QUEUED;
check_preempt_curr(rq, p, 0);

return rq;
Expand Down

0 comments on commit ac40d51

Please sign in to comment.