mirror of
https://github.com/sched-ext/scx.git
synced 2024-11-28 13:40:28 +00:00
scx_bpfland: classify CPUs depending of their the base frequency
Use the base frequency, instead of maximum frequency, to classify fast and slow CPUs. This ensures accurate distinction between Intel Turbo Boost CPUs and genuinely faster CPUs when auto-detecting the primary scheduling domain. Signed-off-by: Andrea Righi <andrea.righi@linux.dev>
This commit is contained in:
parent
bbe388e3bc
commit
695e3b25b0
@ -53,11 +53,12 @@ const SCHEDULER_NAME: &'static str = "scx_bpfland";
|
||||
fn get_primary_cpus(powersave: bool) -> std::io::Result<Vec<usize>> {
|
||||
let topo = Topology::new().unwrap();
|
||||
|
||||
// Iterate over each CPU directory and collect CPU ID and its max frequency.
|
||||
// Iterate over each CPU directory and collect CPU ID and its base operational frequency to
|
||||
// distinguish between fast and slow cores.
|
||||
let mut cpu_freqs = Vec::new();
|
||||
for core in topo.cores().into_iter() {
|
||||
for (cpu_id, cpu) in core.cpus() {
|
||||
cpu_freqs.push((*cpu_id, cpu.max_freq()));
|
||||
cpu_freqs.push((*cpu_id, cpu.base_freq()));
|
||||
}
|
||||
}
|
||||
if cpu_freqs.is_empty() {
|
||||
|
Loading…
Reference in New Issue
Block a user