[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <143dae14-8e6c-4bfa-9754-35013411fca4@nvidia.com>
Date: Tue, 17 Jun 2025 16:12:56 -0400
From: Joel Fernandes <joelagnelf@...dia.com>
To: linux-kernel@...r.kernel.org, Tejun Heo <tj@...nel.org>,
David Vernet <void@...ifault.com>, Andrea Righi <arighi@...dia.com>,
Changwoo Min <changwoo@...lia.com>, Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>, Juri Lelli <juri.lelli@...hat.com>,
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>
Subject: Re: [PATCH v4 14/15] Remove the ext server BW before changing tasks
to FAIR
Sigh, this patch was supposed to be squashed into the "Relinquish DL server
reservations when not needed".
I have updated it in my tree and also squashed the rq_clock patch into the same
to prevent conflicts.
https://git.kernel.org/pub/scm/linux/kernel/git/jfern/linux.git/log/?h=sched/scx-dlserver-boost-rebase
But its a minor thing, and we can review the v4 I sent.
thanks,
- Joel
On 6/17/2025 4:05 PM, Joel Fernandes wrote:
> Signed-off-by: Joel Fernandes <joelagnelf@...dia.com>
> ---
> kernel/sched/ext.c | 39 +++++++++++++++++++++++++--------------
> 1 file changed, 25 insertions(+), 14 deletions(-)
>
> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> index 84ccab8cb838..23e5711bc4fc 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -4960,6 +4960,31 @@ static void scx_disable_workfn(struct kthread_work *work)
>
> scx_init_task_enabled = false;
>
> + for_each_possible_cpu(cpu) {
> + struct rq *rq = cpu_rq(cpu);
> + struct rq_flags rf;
> +
> + /*
> + * Invalidate all the rq clocks to prevent getting outdated
> + * rq clocks from a previous scx scheduler.
> + */
> + scx_rq_clock_invalidate(rq);
> +
> + /*
> + * We are unloading the sched_ext scheduler, we do not need its
> + * DL server bandwidth anymore, remove it for all CPUs. Whenever
> + * the first SCX task is enqueued (when scx is re-loaded), its DL
> + * server bandwidth will be re-initialized.
> + */
> + rq_lock_irqsave(rq, &rf);
> + update_rq_clock(rq);
> + if (dl_server_active(&rq->ext_server))
> + dl_server_stop(&rq->ext_server);
> + dl_server_remove_params(&rq->ext_server);
> + rq_unlock_irqrestore(rq, &rf);
> + }
> +
> +
> scx_task_iter_start(&sti);
> while ((p = scx_task_iter_next_locked(&sti))) {
> const struct sched_class *old_class = p->sched_class;
> @@ -4985,26 +5010,12 @@ static void scx_disable_workfn(struct kthread_work *work)
>
> for_each_possible_cpu(cpu) {
> struct rq *rq = cpu_rq(cpu);
> - struct rq_flags rf;
>
> /*
> * Invalidate all the rq clocks to prevent getting outdated
> * rq clocks from a previous scx scheduler.
> */
> scx_rq_clock_invalidate(rq);
> -
> - /*
> - * We are unloading the sched_ext scheduler, we do not need its
> - * DL server bandwidth anymore, remove it for all CPUs. Whenever
> - * the first SCX task is enqueued (when scx is re-loaded), its DL
> - * server bandwidth will be re-initialized.
> - */
> - rq_lock_irqsave(rq, &rf);
> - update_rq_clock(rq);
> - if (dl_server_active(&rq->ext_server))
> - dl_server_stop(&rq->ext_server);
> - dl_server_remove_params(&rq->ext_server);
> - rq_unlock_irqrestore(rq, &rf);
> }
>
> /* no task is on scx, turn off all the switches and flush in-progress calls */
Powered by blists - more mailing lists