sched: Use an accessor to read the rq clock
Read the runqueue clock through an accessor. This prepares for adding a debugging infrastructure to detect missing or redundant calls to update_rq_clock() between a scheduler's entry and exit point. 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-6-git-send-email-fweisbec@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:

committed by
Ingo Molnar

parent
1a55af2e45
commit
78becc2709
@@ -61,7 +61,7 @@ static inline void sched_info_reset_dequeued(struct task_struct *t)
|
||||
*/
|
||||
static inline void sched_info_dequeued(struct task_struct *t)
|
||||
{
|
||||
unsigned long long now = task_rq(t)->clock, delta = 0;
|
||||
unsigned long long now = rq_clock(task_rq(t)), delta = 0;
|
||||
|
||||
if (unlikely(sched_info_on()))
|
||||
if (t->sched_info.last_queued)
|
||||
@@ -79,7 +79,7 @@ static inline void sched_info_dequeued(struct task_struct *t)
|
||||
*/
|
||||
static void sched_info_arrive(struct task_struct *t)
|
||||
{
|
||||
unsigned long long now = task_rq(t)->clock, delta = 0;
|
||||
unsigned long long now = rq_clock(task_rq(t)), delta = 0;
|
||||
|
||||
if (t->sched_info.last_queued)
|
||||
delta = now - t->sched_info.last_queued;
|
||||
@@ -100,7 +100,7 @@ static inline void sched_info_queued(struct task_struct *t)
|
||||
{
|
||||
if (unlikely(sched_info_on()))
|
||||
if (!t->sched_info.last_queued)
|
||||
t->sched_info.last_queued = task_rq(t)->clock;
|
||||
t->sched_info.last_queued = rq_clock(task_rq(t));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -112,7 +112,7 @@ static inline void sched_info_queued(struct task_struct *t)
|
||||
*/
|
||||
static inline void sched_info_depart(struct task_struct *t)
|
||||
{
|
||||
unsigned long long delta = task_rq(t)->clock -
|
||||
unsigned long long delta = rq_clock(task_rq(t)) -
|
||||
t->sched_info.last_arrival;
|
||||
|
||||
rq_sched_info_depart(task_rq(t), delta);
|
||||
|
Reference in New Issue
Block a user