* [PATCH] sched_ext: Don't warn on core-sched forced idle in put_prev_task_scx()
@ 2026-06-24 23:55 Tejun Heo
0 siblings, 0 replies; only message in thread
From: Tejun Heo @ 2026-06-24 23:55 UTC (permalink / raw)
To: David Vernet, Andrea Righi, Changwoo Min, sched-ext
Cc: Emil Tsalapatis, linux-kernel
put_prev_task_scx() warns when a runnable task drops to a lower
sched_class without SCX_OPS_ENQ_LAST, assuming balance_one() would
otherwise keep it running.
Under core scheduling that assumption is wrong: a forced-idle SMT sibling
reschedules through the core_pick fast path in pick_next_task(), which
skips balance() for the CPU, so balance_one() never runs and a runnable
task can drop to idle with ENQ_LAST unset. Skip the warning when core
scheduling is enabled.
Fixes: 7c65ae81ea86 ("sched_ext: Don't call put_prev_task_scx() before picking the next task")
Signed-off-by: Tejun Heo <tj@kernel.org>
---
kernel/sched/ext/ext.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
index 9c9cb9d08bca..503c4d2105ee 100644
--- a/kernel/sched/ext/ext.c
+++ b/kernel/sched/ext/ext.c
@@ -3092,7 +3092,9 @@ static void put_prev_task_scx(struct rq *rq, struct task_struct *p,
* which should trigger an explicit follow-up scheduling event.
*/
if (next && sched_class_above(&ext_sched_class, next->sched_class)) {
- WARN_ON_ONCE(!(sch->ops.flags & SCX_OPS_ENQ_LAST));
+ /* core-sched can force cpu idle while @p is runnable */
+ if (!sched_core_enabled(rq))
+ WARN_ON_ONCE(!(sch->ops.flags & SCX_OPS_ENQ_LAST));
do_enqueue_task(rq, p, SCX_ENQ_LAST, -1);
} else {
do_enqueue_task(rq, p, 0, -1);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-24 23:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-24 23:55 [PATCH] sched_ext: Don't warn on core-sched forced idle in put_prev_task_scx() Tejun Heo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.