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

scx: Flip order of scx_rq_{de}activate() #220

Merged
merged 1 commit into from
Jun 6, 2024
Merged
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
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