[v3,2/3] sched: Don't trace stat runtime for task group
Commit Message
The rt entity can be a task group. We will trace stat runtime for each
task, so we don't need to trace stat runtime for task group.
Move trace_sched_stat_runtime in update_current_exec_runtime.
Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
---
v3: New patch.
---
kernel/sched/deadline.c | 2 --
kernel/sched/rt.c | 2 --
kernel/sched/sched.h | 1 +
3 files changed, 1 insertion(+), 4 deletions(-)
@@ -1301,8 +1301,6 @@ static void update_curr_dl(struct rq *rq)
schedstat_set(curr->stats.exec_max,
max(curr->stats.exec_max, delta_exec));
- trace_sched_stat_runtime(curr, delta_exec, 0);
-
update_current_exec_runtime(curr, now, delta_exec, true);
if (dl_entity_is_special(dl_se))
@@ -1016,8 +1016,6 @@ static void update_curr_rt(struct rq *rq)
schedstat_set(curr->stats.exec_max,
max(curr->stats.exec_max, delta_exec));
- trace_sched_stat_runtime(curr, delta_exec, 0);
-
update_current_exec_runtime(curr, now, delta_exec,
rt_entity_is_task(rt_se));
@@ -3268,6 +3268,7 @@ static inline void update_current_exec_runtime(struct task_struct *curr,
curr->se.exec_start = now;
if (task) {
+ trace_sched_stat_runtime(curr, delta_exec, curr->se.vruntime);
account_group_exec_runtime(curr, delta_exec);
cgroup_account_cputime(curr, delta_exec);
}