Commit 68e449d8 authored by Honglei Wang's avatar Honglei Wang Committed by Tejun Heo
Browse files

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 f422316d ("sched_ext: Remove switch_class_scx()"). Let's fix
it.

Fixes: f422316d ("sched_ext: Remove switch_class_scx()")
Signed-off-by: default avatarHonglei Wang <jameshongleiwang@126.com>
Acked-by: default avatarAndrea Righi <arighi@nvidia.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 6268d5bc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);
}