diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2013-04-11 19:51:00 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-05-28 03:40:24 -0400 |
commit | 1ad4ec0dc740c4183acd6d6e367ca52b28e4fa94 (patch) | |
tree | 9e50109ed63cdf56ed954a845e257cfefe3149c2 /kernel | |
parent | 71b1da46ff70309a2ec12ce943aa0d192d2c8f0c (diff) |
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 7bf0418dc60f..46d00172ae4a 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -1365,6 +1365,8 @@ static int ttwu_remote(struct task_struct *p, int wake_flags) | |||
1365 | 1365 | ||
1366 | rq = __task_rq_lock(p); | 1366 | rq = __task_rq_lock(p); |
1367 | if (p->on_rq) { | 1367 | if (p->on_rq) { |
1368 | /* check_preempt_curr() may use rq clock */ | ||
1369 | update_rq_clock(rq); | ||
1368 | ttwu_do_wakeup(rq, p, wake_flags); | 1370 | ttwu_do_wakeup(rq, p, wake_flags); |
1369 | ret = 1; | 1371 | ret = 1; |
1370 | } | 1372 | } |