Skip to content

Commit a4a0340

Browse files
htejungregkh
authored andcommitted
sched_ext: Pass held rq to SCX_CALL_OP() for core_sched_before
[ Upstream commit 4155fb4 ] scx_prio_less() runs from core-sched's pick_next_task() path with rq locked but invokes ops.core_sched_before() with NULL locked_rq, leaving scx_locked_rq_state NULL. If the BPF callback calls a kfunc that re-acquires rq based on scx_locked_rq() - e.g. scx_bpf_cpuperf_set(cpu) - it re-acquires the already-held rq. Pass task_rq(a). Fixes: 7b0888b ("sched_ext: Implement core-sched support") Cc: stable@vger.kernel.org # v6.12+ Reported-by: Chris Mason <clm@meta.com> Signed-off-by: Tejun Heo <tj@kernel.org> Reviewed-by: Andrea Righi <arighi@nvidia.com> [ adapted call to use stable's single `sch`/`SCX_KF_REST` mask and `scx_rq_bypassing(task_rq(a))` signature ] Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 255c399 commit a4a0340

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/sched/ext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2522,7 +2522,7 @@ bool scx_prio_less(const struct task_struct *a, const struct task_struct *b,
25222522
if (SCX_HAS_OP(sch, core_sched_before) &&
25232523
!scx_rq_bypassing(task_rq(a)))
25242524
return SCX_CALL_OP_2TASKS_RET(sch, SCX_KF_REST, core_sched_before,
2525-
NULL,
2525+
task_rq(a),
25262526
(struct task_struct *)a,
25272527
(struct task_struct *)b);
25282528
else

0 commit comments

Comments
 (0)