Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

scx: Fix CPU online tracking #215

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions kernel/sched/ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -5741,9 +5741,6 @@ void __init init_sched_ext_class(void)
BUG_ON(!zalloc_cpumask_var(&rq->scx.cpus_to_preempt, GFP_KERNEL));
BUG_ON(!zalloc_cpumask_var(&rq->scx.cpus_to_wait, GFP_KERNEL));
init_irq_work(&rq->scx.kick_cpus_irq_work, kick_cpus_irq_workfn);

if (cpu_online(cpu))
cpu_rq(cpu)->scx.flags |= SCX_RQ_ONLINE;
}

register_sysrq_key('S', &sysrq_sched_ext_reset_op);
Expand Down Expand Up @@ -6965,3 +6962,17 @@ static int __init scx_init(void)
return 0;
}
__initcall(scx_init);


static int __init scx_late_init(void)
{
s32 cpu;

for_each_possible_cpu(cpu) {
if (cpu_online(cpu))
cpu_rq(cpu)->scx.flags |= SCX_RQ_ONLINE;
}

return 0;
}
late_initcall(scx_late_init);