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

Commit 8ee25ad0 authored by Runmin Wang's avatar Runmin Wang
Browse files

sched/core: Fix an ordering issue in wake_up_new_task



If a task is activated before the window_start on the rq is initialized,
its ravg would get reset to 0. However, the init load on this task is
already pushed into the cumulative_runnable_avg. When the task is dequeued,
the task demand (which is reset to 0) will be removed from the
cumulative_runnable_avg, and as a result, the init load will be left
on the runqueue and cra will not be 0 even when CPU is idle.

Change-Id: I7619206dde275f7b64bfcfed206bf0c9a7245cf9
Signed-off-by: default avatarRunmin Wang <runminw@codeaurora.org>
parent e98003de
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2573,8 +2573,8 @@ void wake_up_new_task(struct task_struct *p)
	update_rq_clock(rq);
	post_init_entity_util_avg(&p->se);

	activate_task(rq, p, ENQUEUE_NOCLOCK);
	mark_task_starting(p);
	activate_task(rq, p, ENQUEUE_NOCLOCK);

	p->on_rq = TASK_ON_RQ_QUEUED;
	trace_sched_wakeup_new(p);