Skip to content

Commit e7960da

Browse files
redsky110gregkh
authored andcommitted
sched_ext: switch class when preempted by higher priority scheduler
[ Upstream commit 68e449d ] 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 <[email protected]> Acked-by: Andrea Righi <[email protected]> Signed-off-by: Tejun Heo <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent d9e446d commit e7960da

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
@@ -2917,7 +2917,7 @@ static void put_prev_task_scx(struct rq *rq, struct task_struct *p,
29172917
*/
29182918
if (p->scx.slice && !scx_rq_bypassing(rq)) {
29192919
dispatch_enqueue(&rq->scx.local_dsq, p, SCX_ENQ_HEAD);
2920-
return;
2920+
goto switch_class;
29212921
}
29222922

29232923
/*
@@ -2934,6 +2934,7 @@ static void put_prev_task_scx(struct rq *rq, struct task_struct *p,
29342934
}
29352935
}
29362936

2937+
switch_class:
29372938
if (next && next->sched_class != &ext_sched_class)
29382939
switch_class(rq, next);
29392940
}

0 commit comments

Comments
 (0)