Merge pull request #188 from sched-ext/topology-fix-single-cpu

topology: support single CPU systems
This commit is contained in:
David Vernet 2024-03-14 13:16:59 -05:00 committed by GitHub
commit 3ad0fff855
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -281,8 +281,13 @@ fn cpus_online() -> Result<Cpumask> {
let (min, max) = match sscanf!(group.trim(), "{usize}-{usize}") {
Ok((x, y)) => (x, y),
Err(_) => {
bail!("Failed to parse online cpus {}", group.trim());
}
match sscanf!(group.trim(), "{usize}") {
Ok(x) => (x, x),
Err(_) => {
bail!("Failed to parse online cpus {}", group.trim());
}
}
},
};
for i in min..(max + 1) {
mask.set_cpu(i)?;