mirror of
https://github.com/JakeHillion/scx.git
synced 2024-11-30 04:50:24 +00:00
scx: Demote panic! to warn! in topology crate
We currently panic! if we're building a Topology that detects more than two siblings on a physical core. This can and will likely happen on multi-socket machines. Given that we're planning to add support for detecting NUMA nodes soon, let's just demote the panic! to a warn!. Signed-off-by: David Vernet <void@manifault.com>
This commit is contained in:
parent
22d635c385
commit
49065de8df
@ -112,6 +112,7 @@ use anyhow::Result;
|
||||
use bitvec::prelude::*;
|
||||
|
||||
use log::info;
|
||||
use log::warn;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Domain {
|
||||
@ -222,7 +223,12 @@ impl TopologyBuilder {
|
||||
cpu_to_node[cpu] = id;
|
||||
if node_to_cpu.contains_key(&id) {
|
||||
if nodes_completed.contains(&id) {
|
||||
panic!("More than two CPUs detected in node {}", id);
|
||||
// This can happen in multi-socket machines where a core ID
|
||||
// will be the same across two different nodes. Once we add
|
||||
// support for NUMA nodes, this should no longer be an issue
|
||||
// (unless we're running on architectures with more than 2
|
||||
// SMT siblings).
|
||||
warn!("More than two CPUs detected in node {}: siblings may be invalid", id);
|
||||
}
|
||||
|
||||
let sibling = node_to_cpu.get(&id).unwrap().clone();
|
||||
|
Loading…
Reference in New Issue
Block a user