[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aOYDzzC83FZdNNGi@jlelli-thinkpadt14gen4.remote.csb>
Date: Wed, 8 Oct 2025 08:25:19 +0200
From: Juri Lelli <juri.lelli@...hat.com>
To: Yuri Andriaccio <yurand2000@...il.com>
Cc: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Valentin Schneider <vschneid@...hat.com>,
linux-kernel@...r.kernel.org,
Luca Abeni <luca.abeni@...tannapisa.it>,
Yuri Andriaccio <yuri.andriaccio@...tannapisa.it>
Subject: Re: [RFC PATCH v3 08/24] sched/deadline: Add dl_init_tg
Hello,
On 29/09/25 11:22, Yuri Andriaccio wrote:
> From: luca abeni <luca.abeni@...tannapisa.it>
>
> Add dl_init_tg to initialize and/or update a rt-cgroup dl_server and to
> also account the allocated bandwidth.
>
> Co-developed-by: Alessio Balsini <a.balsini@...up.it>
> Signed-off-by: Alessio Balsini <a.balsini@...up.it>
> Co-developed-by: Andrea Parri <parri.andrea@...il.com>
> Signed-off-by: Andrea Parri <parri.andrea@...il.com>
> Co-developed-by: Yuri Andriaccio <yurand2000@...il.com>
> Signed-off-by: Yuri Andriaccio <yurand2000@...il.com>
> Signed-off-by: luca abeni <luca.abeni@...tannapisa.it>
> ---
> kernel/sched/deadline.c | 33 +++++++++++++++++++++++++++++++++
> kernel/sched/sched.h | 1 +
> 2 files changed, 34 insertions(+)
>
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 5c8fe80b585..34a1494d782 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -340,6 +340,39 @@ void cancel_inactive_timer(struct sched_dl_entity *dl_se)
> cancel_dl_timer(dl_se, &dl_se->inactive_timer);
> }
>
> +#ifdef CONFIG_RT_GROUP_SCHED
> +void dl_init_tg(struct sched_dl_entity *dl_se, u64 rt_runtime, u64 rt_period)
This is not called from anywhere at this point, is it? I wonder if we
want to introduce dead code for later usage or if it would make more
sense to introduce it together with the calling sites.
> +{
> + struct rq *rq = container_of(dl_se->dl_rq, struct rq, dl);
> + int is_active;
> + u64 new_bw;
> +
> + raw_spin_rq_lock_irq(rq);
> + is_active = dl_se->my_q->rt.rt_nr_running > 0;
> +
> + update_rq_clock(rq);
> + dl_server_stop(dl_se);
> +
> + new_bw = to_ratio(dl_se->dl_period, dl_se->dl_runtime);
Is this correct? Not sure yet where/how dl_init_tg() is called, but
don't we want to compute new_bw using rt_runtime and rt_period?
Thanks,
Juri
Powered by blists - more mailing lists