[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aN6FtY-J3WXlGaNv@jlelli-thinkpadt14gen4.remote.csb>
Date: Thu, 2 Oct 2025 15:01:25 +0100
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 03/24] sched/rt: Pass an rt_rq instead of an rq
where needed
Hello,
On 29/09/25 11:22, Yuri Andriaccio wrote:
> From: luca abeni <luca.abeni@...tannapisa.it>
>
> Make rt.c code access the runqueue through the rt_rq data structure rather than
> passing an rq pointer directly. This allows future patches to define rt_rq data
> structures which do not refer only to the global runqueue, but also to local
> cgroup runqueues (rt_rq is not always equal to &rq->rt).
>
> Signed-off-by: luca abeni <luca.abeni@...tannapisa.it>
> Signed-off-by: Yuri Andriaccio <yurand2000@...il.com>
> ---
> kernel/sched/rt.c | 99 ++++++++++++++++++++++++++---------------------
> 1 file changed, 54 insertions(+), 45 deletions(-)
>
> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index 7936d433373..a7d063d2303 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -370,9 +370,9 @@ static inline void rt_clear_overload(struct rq *rq)
> cpumask_clear_cpu(rq->cpu, rq->rd->rto_mask);
> }
>
> -static inline int has_pushable_tasks(struct rq *rq)
> +static inline int has_pushable_tasks(struct rt_rq *rt_rq)
> {
> - return !plist_head_empty(&rq->rt.pushable_tasks);
> + return !plist_head_empty(&rt_rq->pushable_tasks);
> }
>
> static DEFINE_PER_CPU(struct balance_callback, rt_push_head);
> @@ -381,50 +381,54 @@ static DEFINE_PER_CPU(struct balance_callback, rt_pull_head);
> static void push_rt_tasks(struct rq *);
> static void pull_rt_task(struct rq *);
>
> -static inline void rt_queue_push_tasks(struct rq *rq)
> +static inline void rt_queue_push_tasks(struct rt_rq * rt_rq)
Nit, remove space ^^^
> {
> - if (!has_pushable_tasks(rq))
> + struct rq *rq = container_of(rt_rq, struct rq, rt);
> +
> + if (!has_pushable_tasks(rt_rq))
> return;
>
> queue_balance_callback(rq, &per_cpu(rt_push_head, rq->cpu), push_rt_tasks);
> }
>
> -static inline void rt_queue_pull_task(struct rq *rq)
> +static inline void rt_queue_pull_task(struct rt_rq * rt_rq)
Nit, remove space ^^^
> {
> + struct rq *rq = container_of(rt_rq, struct rq, rt);
Still need to check with the full series (and it's OK up until here),
but I guess this needs special attention with tasks inside groups to
make sure we don't queue callbacks in rqs representing groups?
> +
> queue_balance_callback(rq, &per_cpu(rt_pull_head, rq->cpu), pull_rt_task);
> }
Thanks,
Juri
Powered by blists - more mailing lists