summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorHonglei Wang <jameshongleiwang@126.com>2025-01-08 03:33:28 +0100
committerTejun Heo <tj@kernel.org>2025-01-08 17:51:40 +0100
commit68e449d849fd50bd5e61d8bd32b3458dbd3a3df6 (patch)
tree6ce4c4cfb0eb8d1a949545c4910f049c36c15a34 /kernel
parentsched_ext: Replace rq_lock() to raw_spin_rq_lock() in scx_ops_bypass() (diff)
downloadlinux-68e449d849fd50bd5e61d8bd32b3458dbd3a3df6.tar.xz
linux-68e449d849fd50bd5e61d8bd32b3458dbd3a3df6.zip
sched_ext: switch class when preempted by higher priority scheduler
ops.cpu_release() function, if defined, must be invoked when preempted by a higher priority scheduler class task. This scenario was skipped in commit f422316d7466 ("sched_ext: Remove switch_class_scx()"). Let's fix it. Fixes: f422316d7466 ("sched_ext: Remove switch_class_scx()") Signed-off-by: Honglei Wang <jameshongleiwang@126.com> Acked-by: Andrea Righi <arighi@nvidia.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/ext.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 11a0e1a9d86e..68150e110451 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -3037,7 +3037,7 @@ static void put_prev_task_scx(struct rq *rq, struct task_struct *p,
*/
if (p->scx.slice && !scx_rq_bypassing(rq)) {
dispatch_enqueue(&rq->scx.local_dsq, p, SCX_ENQ_HEAD);
- return;
+ goto switch_class;
}
/*
@@ -3054,6 +3054,7 @@ static void put_prev_task_scx(struct rq *rq, struct task_struct *p,
}
}
+switch_class:
if (next && next->sched_class != &ext_sched_class)
switch_class(rq, next);
}