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

Commit

Permalink
Merge pull request #220 from sched-ext/fix_hotplug
Browse files Browse the repository at this point in the history
scx: Flip order of scx_rq_{de}activate()
  • Loading branch information
Byte-Lab authored Jun 6, 2024
2 parents 9ee6343 + 56d4acf commit 25c10e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/sched/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -9777,6 +9777,8 @@ int sched_cpu_activate(unsigned int cpu)
cpuset_cpu_active();
}

scx_rq_activate(rq);

/*
* Put the rq online, if not already. This happens:
*
Expand All @@ -9792,7 +9794,6 @@ int sched_cpu_activate(unsigned int cpu)
set_rq_online(rq);
}
rq_unlock_irqrestore(rq, &rf);
scx_rq_activate(rq);

return 0;
}
Expand Down Expand Up @@ -9831,14 +9832,15 @@ int sched_cpu_deactivate(unsigned int cpu)
*/
synchronize_rcu();

scx_rq_deactivate(rq);
rq_lock_irqsave(rq, &rf);
if (rq->rd) {
BUG_ON(!cpumask_test_cpu(cpu, rq->rd->span));
set_rq_offline(rq);
}
rq_unlock_irqrestore(rq, &rf);

scx_rq_deactivate(rq);

#ifdef CONFIG_SCHED_SMT
/*
* When going down, decrement the number of cores with SMT present.
Expand Down

0 comments on commit 25c10e0

Please sign in to comment.