Messages in this thread |  | | Date | Sun, 17 Dec 2023 16:19:27 +0000 | | From | Qais Yousef <> | | Subject | Re: [PATCH v6 01/20] sched: Unify runtime accounting across classes |
| |
On 11/06/23 19:34, John Stultz wrote: > From: Peter Zijlstra <peterz@infradead.org> > > All classes use sched_entity::exec_start to track runtime and have > copies of the exact same code around to compute runtime. > > Collapse all that. > > Cc: Joel Fernandes <joelaf@google.com> > Cc: Qais Yousef <qyousef@google.com> > Cc: Ingo Molnar <mingo@redhat.com> > Cc: Peter Zijlstra <peterz@infradead.org> > Cc: Juri Lelli <juri.lelli@redhat.com> > Cc: Vincent Guittot <vincent.guittot@linaro.org> > Cc: Dietmar Eggemann <dietmar.eggemann@arm.com> > Cc: Valentin Schneider <vschneid@redhat.com> > Cc: Steven Rostedt <rostedt@goodmis.org> > Cc: Ben Segall <bsegall@google.com> > Cc: Zimuzo Ezeozue <zezeozue@google.com> > Cc: Youssef Esmat <youssefesmat@google.com> > Cc: Mel Gorman <mgorman@suse.de> > Cc: Daniel Bristot de Oliveira <bristot@redhat.com> > Cc: Will Deacon <will@kernel.org> > Cc: Waiman Long <longman@redhat.com> > Cc: Boqun Feng <boqun.feng@gmail.com> > Cc: "Paul E . McKenney" <paulmck@kernel.org> > Cc: kernel-team@android.com > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> > [fix conflicts, fold in update_current_exec_runtime] > Signed-off-by: Connor O'Brien <connoro@google.com> > [jstultz: rebased, resovling minor conflicts] > Signed-off-by: John Stultz <jstultz@google.com> > --- > NOTE: This patch is a general cleanup and if no one objects > could be merged at this point. If needed, I'll resend separately > if it isn't picked up on its own.
Looks like this actually got merged into tip via the deadline server work :-)
Though not sure if I caught a bug here
> diff --git a/kernel/sched/stop_task.c b/kernel/sched/stop_task.c > index 85590599b4d6..7595494ceb6d 100644 > --- a/kernel/sched/stop_task.c > +++ b/kernel/sched/stop_task.c > @@ -70,18 +70,7 @@ static void yield_task_stop(struct rq *rq) > > static void put_prev_task_stop(struct rq *rq, struct task_struct *prev) > { > - struct task_struct *curr = rq->curr; > - u64 now, delta_exec; > - > - now = rq_clock_task(rq); > - delta_exec = now - curr->se.exec_start; > - if (unlikely((s64)delta_exec < 0)) > - delta_exec = 0;
If negative instead of returning for stopper task; we set delta_exec to 0
> - > - schedstat_set(curr->stats.exec_max, > - max(curr->stats.exec_max, delta_exec)); > - > - update_current_exec_runtime(curr, now, delta_exec);
And curry on to do time accounting
> + update_curr_common(rq);
But the new function will return early without doing accounting. Wouldn't this re-introrduce 8f6189684eb4 ("sched: Fix migration thread runtime bogosity")?
> }
Cheers
-- Qais Yousef
|  |