Skip to content

Commit e38be1c

Browse files
arighihtejun
authored andcommitted
sched_ext: Fix rq lock state in hotplug ops
The ops.cpu_online() and ops.cpu_offline() callbacks incorrectly assume that the rq involved in the operation is locked, which is not the case during hotplug, triggering the following warning: WARNING: CPU: 1 PID: 20 at kernel/sched/sched.h:1504 handle_hotplug+0x280/0x340 Fix by not tracking the target rq as locked in the context of ops.cpu_online() and ops.cpu_offline(). Fixes: 18853ba ("sched_ext: Track currently locked rq") Reported-by: Tejun Heo <[email protected]> Signed-off-by: Andrea Righi <[email protected]> Tested-by: Changwoo Min <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent e7dcd13 commit e38be1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/sched/ext.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3477,9 +3477,9 @@ static void handle_hotplug(struct rq *rq, bool online)
34773477
scx_idle_update_selcpu_topology(&scx_ops);
34783478

34793479
if (online && SCX_HAS_OP(cpu_online))
3480-
SCX_CALL_OP(SCX_KF_UNLOCKED, cpu_online, rq, cpu);
3480+
SCX_CALL_OP(SCX_KF_UNLOCKED, cpu_online, NULL, cpu);
34813481
else if (!online && SCX_HAS_OP(cpu_offline))
3482-
SCX_CALL_OP(SCX_KF_UNLOCKED, cpu_offline, rq, cpu);
3482+
SCX_CALL_OP(SCX_KF_UNLOCKED, cpu_offline, NULL, cpu);
34833483
else
34843484
scx_ops_exit(SCX_ECODE_ACT_RESTART | SCX_ECODE_RSN_HOTPLUG,
34853485
"cpu %d going %s, exiting scheduler", cpu,

0 commit comments

Comments
 (0)