Skip to content

Commit 1ad4ec0

Browse files
fweisbecingomolnar
authored andcommitted
sched: Update rq clock before calling check_preempt_curr()
check_preempt_curr() of fair class needs an uptodate sched clock value to update runtime stats of the current task of the target's rq. When a task is woken up, activate_task() is usually called right before ttwu_do_wakeup() unless the task is still in the runqueue. In the latter case we need to update the rq clock explicitly because activate_task() isn't here to do the job for us. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Li Zhong <zhong@linux.vnet.ibm.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Paul Turner <pjt@google.com> Cc: Mike Galbraith <efault@gmx.de> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1365724262-20142-4-git-send-email-fweisbec@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 71b1da4 commit 1ad4ec0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎kernel/sched/core.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,6 +1365,8 @@ static int ttwu_remote(struct task_struct *p, int wake_flags)
13651365

13661366
rq = __task_rq_lock(p);
13671367
if (p->on_rq) {
1368+
/* check_preempt_curr() may use rq clock */
1369+
update_rq_clock(rq);
13681370
ttwu_do_wakeup(rq, p, wake_flags);
13691371
ret = 1;
13701372
}

0 commit comments

Comments
 (0)