[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250920005931.2753828-36-tj@kernel.org>
Date: Fri, 19 Sep 2025 14:58:58 -1000
From: Tejun Heo <tj@...nel.org>
To: void@...ifault.com,
arighi@...dia.com,
multics69@...il.com
Cc: linux-kernel@...r.kernel.org,
sched-ext@...ts.linux.dev,
memxor@...il.com,
bpf@...r.kernel.org,
Tejun Heo <tj@...nel.org>
Subject: [PATCH 35/46] sched_ext: Dispatch from all scx_sched instances
The cgroup sub-sched support involves invasive changes to many areas of
sched_ext. The overall scaffolding is now in place and the next step is
implementing sub-sched enable/disable.
To enable partial testing and verification, update balance_one() to
dispatch from all scx_sched instances until it finds a task to run. This
should keep scheduling working when sub-scheds are enabled with tasks on
them. This will be replaced by BPF-driven hierarchical operation.
Signed-off-by: Tejun Heo <tj@...nel.org>
---
kernel/sched/ext.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 714b45a55112..75a4b05fced4 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -2239,7 +2239,7 @@ static bool scx_dispatch_sched(struct scx_sched *sch, struct rq *rq,
static int balance_one(struct rq *rq, struct task_struct *prev)
{
- struct scx_sched *sch = scx_root;
+ struct scx_sched *sch = scx_root, *pos;
lockdep_assert_rq_held(rq);
rq->scx.flags |= SCX_RQ_IN_BALANCE;
@@ -2283,9 +2283,13 @@ static int balance_one(struct rq *rq, struct task_struct *prev)
if (rq->scx.local_dsq.nr)
goto has_tasks;
- /* dispatch @sch */
- if (scx_dispatch_sched(sch, rq, prev))
- goto has_tasks;
+ /*
+ * TEMPORARY - Dispatch all scheds. This will be replaced by BPF-driven
+ * hierarchical operation.
+ */
+ list_for_each_entry_rcu(pos, &scx_sched_all, all)
+ if (scx_dispatch_sched(pos, rq, prev))
+ goto has_tasks;
/*
* Didn't find another task to run. Keep running @prev unless
--
2.51.0
Powered by blists - more mailing lists