Commit c708a4dc authored by Peter Zijlstra's avatar Peter Zijlstra

sched: Unify more update_curr*()

Now that trace_sched_stat_runtime() no longer takes a vruntime
argument, the task specific bits are identical between
update_curr_common() and update_curr().
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
parent 5fe6ec8f
...@@ -1126,6 +1126,13 @@ static s64 update_curr_se(struct rq *rq, struct sched_entity *curr) ...@@ -1126,6 +1126,13 @@ static s64 update_curr_se(struct rq *rq, struct sched_entity *curr)
return delta_exec; return delta_exec;
} }
static inline void update_curr_task(struct task_struct *p, s64 delta_exec)
{
trace_sched_stat_runtime(p, delta_exec);
account_group_exec_runtime(p, delta_exec);
cgroup_account_cputime(p, delta_exec);
}
/* /*
* Used by other classes to account runtime. * Used by other classes to account runtime.
*/ */
...@@ -1135,12 +1142,8 @@ s64 update_curr_common(struct rq *rq) ...@@ -1135,12 +1142,8 @@ s64 update_curr_common(struct rq *rq)
s64 delta_exec; s64 delta_exec;
delta_exec = update_curr_se(rq, &curr->se); delta_exec = update_curr_se(rq, &curr->se);
if (unlikely(delta_exec <= 0)) if (likely(delta_exec > 0))
return delta_exec; update_curr_task(curr, delta_exec);
trace_sched_stat_runtime(curr, delta_exec);
account_group_exec_runtime(curr, delta_exec);
cgroup_account_cputime(curr, delta_exec);
return delta_exec; return delta_exec;
} }
...@@ -1164,13 +1167,8 @@ static void update_curr(struct cfs_rq *cfs_rq) ...@@ -1164,13 +1167,8 @@ static void update_curr(struct cfs_rq *cfs_rq)
update_deadline(cfs_rq, curr); update_deadline(cfs_rq, curr);
update_min_vruntime(cfs_rq); update_min_vruntime(cfs_rq);
if (entity_is_task(curr)) { if (entity_is_task(curr))
struct task_struct *curtask = task_of(curr); update_curr_task(task_of(curr), delta_exec);
trace_sched_stat_runtime(curtask, delta_exec);
cgroup_account_cputime(curtask, delta_exec);
account_group_exec_runtime(curtask, delta_exec);
}
account_cfs_rq_runtime(cfs_rq, delta_exec); account_cfs_rq_runtime(cfs_rq, delta_exec);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment