Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9dca1e0 authored by Srivatsa Vaddagiri's avatar Srivatsa Vaddagiri Committed by Ingo Molnar
Browse files

sched: fix new task startup crash



Child task may be added on a different cpu that the one on which parent
is running. In which case, task_new_fair() should check whether the new
born task's parent entity should be added as well on the cfs_rq.

Patch below fixes the problem in task_new_fair.

This could fix the put_prev_task_fair() crashes reported.

Reported-by: default avatarKamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Reported-by: default avatarAndy Whitcroft <apw@shadowen.org>
Signed-off-by: default avatarSrivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent b1a8c172
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1712,7 +1712,7 @@ void fastcall wake_up_new_task(struct task_struct *p, unsigned long clone_flags)

	p->prio = effective_prio(p);

	if (!p->sched_class->task_new || !current->se.on_rq || !rq->cfs.curr) {
	if (!p->sched_class->task_new || !current->se.on_rq) {
		activate_task(rq, p, 0);
	} else {
		/*
+1 −5
Original line number Diff line number Diff line
@@ -1031,12 +1031,8 @@ static void task_new_fair(struct rq *rq, struct task_struct *p)
		swap(curr->vruntime, se->vruntime);
	}

	update_stats_enqueue(cfs_rq, se);
	check_spread(cfs_rq, se);
	check_spread(cfs_rq, curr);
	__enqueue_entity(cfs_rq, se);
	account_entity_enqueue(cfs_rq, se);
	se->peer_preempt = 0;
	enqueue_task_fair(rq, p, 0);
	resched_task(rq->curr);
}