Skip to content

Commit a4af89c

Browse files
committed
sched_ext: ops.cpu_acquire() should be called with SCX_KF_REST
ops.cpu_acquire() is currently called with 0 kf_maks which is interpreted as SCX_KF_UNLOCKED which allows all unlocked kfuncs, but ops.cpu_acquire() is called from balance_one() under the rq lock and should only be allowed call kfuncs that are safe under the rq lock. Update it to use SCX_KF_REST. Signed-off-by: Tejun Heo <[email protected]> Cc: David Vernet <[email protected]> Cc: Zhao Mengmeng <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Fixes: 245254f ("sched_ext: Implement sched_ext_ops.cpu_acquire/release()")
1 parent a6250aa commit a4af89c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched/ext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2645,7 +2645,7 @@ static int balance_one(struct rq *rq, struct task_struct *prev)
26452645
* emitted in scx_next_task_picked().
26462646
*/
26472647
if (SCX_HAS_OP(cpu_acquire))
2648-
SCX_CALL_OP(0, cpu_acquire, cpu_of(rq), NULL);
2648+
SCX_CALL_OP(SCX_KF_REST, cpu_acquire, cpu_of(rq), NULL);
26492649
rq->scx.cpu_released = false;
26502650
}
26512651

0 commit comments

Comments
 (0)