summaryrefslogtreecommitdiff
path: root/kernel/sched/fair.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2019-04-09 09:59:05 +0200
committerIngo Molnar <mingo@kernel.org>2019-04-16 16:55:17 +0200
commit7dd7788411646c9619aa6495f832bc0a9b0146b5 (patch)
treef5d8616364b40b4195b4e33439ef8b29c6710e64 /kernel/sched/fair.c
parent1b174a2cb67a3a156d5a28426ae14241e6dfa655 (diff)
sched/core: Unify p->on_rq updates
Almost all {,de}activate_task() invocations pair with p->on_rq updates, the exception being the usage in rt/deadline which hold both rq locks and therefore don't strictly need to set TASK_ON_RQ_MIGRATING, but it is harmless if we do anyway. Put the updates in {,de}activate_task() and cut down on repetition. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/fair.c')
-rw-r--r--kernel/sched/fair.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index b6cc0703b850..e5b100b6ba4e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7491,7 +7491,6 @@ static void detach_task(struct task_struct *p, struct lb_env *env)
{
lockdep_assert_held(&env->src_rq->lock);
- p->on_rq = TASK_ON_RQ_MIGRATING;
deactivate_task(env->src_rq, p, DEQUEUE_NOCLOCK);
set_task_cpu(p, env->dst_cpu);
}
@@ -7627,7 +7626,6 @@ static void attach_task(struct rq *rq, struct task_struct *p)
BUG_ON(task_rq(p) != rq);
activate_task(rq, p, ENQUEUE_NOCLOCK);
- p->on_rq = TASK_ON_RQ_QUEUED;
check_preempt_curr(rq, p, 0);
}