Skip to content

Commit 68e449d

Browse files
redsky110htejun
authored andcommitted
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 f422316 ("sched_ext: Remove switch_class_scx()"). Let's fix it. Fixes: f422316 ("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>
1 parent 6268d5b commit 68e449d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/sched/ext.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3037,7 +3037,7 @@ static void put_prev_task_scx(struct rq *rq, struct task_struct *p,
30373037
*/
30383038
if (p->scx.slice && !scx_rq_bypassing(rq)) {
30393039
dispatch_enqueue(&rq->scx.local_dsq, p, SCX_ENQ_HEAD);
3040-
return;
3040+
goto switch_class;
30413041
}
30423042

30433043
/*
@@ -3054,6 +3054,7 @@ static void put_prev_task_scx(struct rq *rq, struct task_struct *p,
30543054
}
30553055
}
30563056

3057+
switch_class:
30573058
if (next && next->sched_class != &ext_sched_class)
30583059
switch_class(rq, next);
30593060
}

0 commit comments

Comments
 (0)