Re: [PATCH v4 1/7] sched: Unify runtime accounting across classes

From: Steven Rostedt
Date: Fri Sep 15 2023 - 17:42:27 EST


On Thu, 31 Aug 2023 22:28:52 +0200
Daniel Bristot de Oliveira <bristot@xxxxxxxxxx> wrote:

As I have a vested interest in this work, I started a deep dive into the
code.

> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -1299,9 +1299,8 @@ static void update_curr_dl(struct rq *rq)
> {
> struct task_struct *curr = rq->curr;
> struct sched_dl_entity *dl_se = &curr->dl;
> - u64 delta_exec, scaled_delta_exec;
> + s64 delta_exec, scaled_delta_exec;
> int cpu = cpu_of(rq);
> - u64 now;
>
> if (!dl_task(curr) || !on_dl_rq(dl_se))
> return;
> @@ -1314,21 +1313,13 @@ static void update_curr_dl(struct rq *rq)
> * natural solution, but the full ramifications of this
> * approach need further study.
> */
> - now = rq_clock_task(rq);
> - delta_exec = now - curr->se.exec_start;
> - if (unlikely((s64)delta_exec <= 0)) {
> + delta_exec = update_curr_common(rq);

I have to say, mapping the update_curr_common() to the removed code below,
wasn't as easy as I thought it would be, as the above function is broken up
slightly differently.

But the conclusion does appear to be pretty much the same.

Reviewed-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>

-- Steve


> + if (unlikely(delta_exec <= 0)) {
> if (unlikely(dl_se->dl_yielded))
> goto throttle;
> return;
> }
>
> - 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);
> -
> if (dl_entity_is_special(dl_se))
> return;
>